Add title column to chapters
This commit is contained in:
parent
0335c1eb08
commit
142b94722e
2
api/resources/db/migration/V6__Update_chapter_table.sql
Normal file
2
api/resources/db/migration/V6__Update_chapter_table.sql
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE `Chapters`
|
||||||
|
ADD COLUMN `title` varchar(50);
|
||||||
@ -7,6 +7,7 @@ interface Chapter : Entity<Chapter> {
|
|||||||
|
|
||||||
val id: Int
|
val id: Int
|
||||||
var number: Int
|
var number: Int
|
||||||
|
var title: String
|
||||||
var content: String
|
var content: String
|
||||||
var note: Note
|
var note: Note
|
||||||
}
|
}
|
||||||
@ -11,6 +11,7 @@ object Chapters : Table<Chapter>("Chapters") {
|
|||||||
val id by int("id").primaryKey().bindTo { it.id }
|
val id by int("id").primaryKey().bindTo { it.id }
|
||||||
val number by int("number").bindTo { it.number }
|
val number by int("number").bindTo { it.number }
|
||||||
val content by text("content").bindTo { it.content }
|
val content by text("content").bindTo { it.content }
|
||||||
|
val title by varchar("title").bindTo { it.title }
|
||||||
val noteId by int("note_id").references(Notes) { it.note }
|
val noteId by int("note_id").references(Notes) { it.note }
|
||||||
val note get() = noteId.referenceTable as Notes
|
val note get() = noteId.referenceTable as Notes
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user