Change notes columns

This commit is contained in:
Hubert Van De Walle 2020-04-19 21:31:03 +02:00
parent 68d8363ebf
commit e4d8bffe71
3 changed files with 7 additions and 2 deletions

View File

@ -0,0 +1,5 @@
ALTER TABLE `Notes`
DROP COLUMN `last_viewed`;
ALTER TABLE `Notes`
ADD COLUMN `updated_at` datetime;

View File

@ -9,5 +9,5 @@ interface Note : Entity<Note> {
val id: Int
var title: String
var user: User
var lastViewed: LocalDateTime?
var updatedAt: LocalDateTime?
}

View File

@ -7,5 +7,5 @@ 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 lastViewed by datetime("last_viewed").bindTo { it.lastViewed }
val updatedAt by datetime("last_viewed").bindTo { it.updatedAt }
}