diff --git a/api/resources/db/migration/V5__Update_note_table.sql b/api/resources/db/migration/V5__Update_note_table.sql new file mode 100644 index 0000000..980637b --- /dev/null +++ b/api/resources/db/migration/V5__Update_note_table.sql @@ -0,0 +1,5 @@ +ALTER TABLE `Notes` + DROP COLUMN `last_viewed`; + +ALTER TABLE `Notes` + ADD COLUMN `updated_at` datetime; diff --git a/api/src/entities/Note.kt b/api/src/entities/Note.kt index a0c8b03..c91e421 100644 --- a/api/src/entities/Note.kt +++ b/api/src/entities/Note.kt @@ -9,5 +9,5 @@ interface Note : Entity { val id: Int var title: String var user: User - var lastViewed: LocalDateTime? + var updatedAt: LocalDateTime? } \ No newline at end of file diff --git a/api/src/tables/Notes.kt b/api/src/tables/Notes.kt index 9282f08..822faef 100644 --- a/api/src/tables/Notes.kt +++ b/api/src/tables/Notes.kt @@ -7,5 +7,5 @@ object Notes : Table("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 } } \ No newline at end of file