Change notes columns
This commit is contained in:
parent
68d8363ebf
commit
e4d8bffe71
5
api/resources/db/migration/V5__Update_note_table.sql
Normal file
5
api/resources/db/migration/V5__Update_note_table.sql
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
ALTER TABLE `Notes`
|
||||||
|
DROP COLUMN `last_viewed`;
|
||||||
|
|
||||||
|
ALTER TABLE `Notes`
|
||||||
|
ADD COLUMN `updated_at` datetime;
|
||||||
@ -9,5 +9,5 @@ interface Note : Entity<Note> {
|
|||||||
val id: Int
|
val id: Int
|
||||||
var title: String
|
var title: String
|
||||||
var user: User
|
var user: User
|
||||||
var lastViewed: LocalDateTime?
|
var updatedAt: LocalDateTime?
|
||||||
}
|
}
|
||||||
@ -7,5 +7,5 @@ object Notes : Table<Note>("Notes") {
|
|||||||
val id by int("id").primaryKey().bindTo { it.id }
|
val id by int("id").primaryKey().bindTo { it.id }
|
||||||
val title by varchar("title").bindTo { it.title }
|
val title by varchar("title").bindTo { it.title }
|
||||||
val user by int("user_id").references(Users) { it.user }
|
val user by int("user_id").references(Users) { it.user }
|
||||||
val lastViewed by datetime("last_viewed").bindTo { it.lastViewed }
|
val updatedAt by datetime("last_viewed").bindTo { it.updatedAt }
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user