DONE !!
This commit is contained in:
@@ -12,4 +12,5 @@ object Chapters : Table<Chapter>("Chapters") {
|
||||
val number by int("number").bindTo { it.number }
|
||||
val content by text("content").bindTo { it.content }
|
||||
val noteId by int("note_id").references(Notes) { it.note }
|
||||
val note get() = noteId.referenceTable as Notes
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import me.liuwj.ktorm.schema.*
|
||||
object Notes : Table<Note>("Notes") {
|
||||
val id by int("id").primaryKey().bindTo { it.id }
|
||||
val title by varchar("title").bindTo { it.title }
|
||||
val user by int("user_id").references(Users) { it.user }
|
||||
val updatedAt by datetime("last_viewed").bindTo { it.updatedAt }
|
||||
val userId by int("user_id").references(Users) { it.user }
|
||||
val updatedAt by datetime("updated_at").bindTo { it.updatedAt }
|
||||
val user get() = userId.referenceTable as Users
|
||||
}
|
||||
@@ -9,4 +9,5 @@ object Tags : Table<Tag>("Tags") {
|
||||
val id by int("id").primaryKey().bindTo { it.id }
|
||||
val name by varchar("name").bindTo { it.name }
|
||||
val noteId by int("note_id").references(Notes) { it.note }
|
||||
val note get() = noteId.referenceTable as Notes
|
||||
}
|
||||
Reference in New Issue
Block a user