mirror of
https://github.com/dalbodeule/chibot-chzzk-bot.git
synced 2025-08-08 05:11:12 +00:00
move hibernate to exposed...
This commit is contained in:
21
src/main/kotlin/space/mori/chzzk_bot/models/User.kt
Normal file
21
src/main/kotlin/space/mori/chzzk_bot/models/User.kt
Normal file
@@ -0,0 +1,21 @@
|
||||
package space.mori.chzzk_bot.models
|
||||
|
||||
import org.jetbrains.exposed.dao.IntEntity
|
||||
import org.jetbrains.exposed.dao.IntEntityClass
|
||||
import org.jetbrains.exposed.dao.id.EntityID
|
||||
import org.jetbrains.exposed.dao.id.IntIdTable
|
||||
|
||||
|
||||
object Users: IntIdTable("users") {
|
||||
val username = varchar("username", 255)
|
||||
val token = varchar("token", 64)
|
||||
val discord = long("discord")
|
||||
}
|
||||
|
||||
class User(id: EntityID<Int>) : IntEntity(id) {
|
||||
companion object : IntEntityClass<User>(Users)
|
||||
|
||||
var username by Users.username
|
||||
var token by Users.token
|
||||
var discord by Users.discord
|
||||
}
|
Reference in New Issue
Block a user