diff --git a/api/src/main/resources/db/migration/V7__add_gallery.sql b/api/src/main/resources/db/migration/V7__add_gallery.sql index b080ba89..28a5cde7 100644 --- a/api/src/main/resources/db/migration/V7__add_gallery.sql +++ b/api/src/main/resources/db/migration/V7__add_gallery.sql @@ -4,6 +4,7 @@ create table if not exists gallery ( survey_id BIGINT unique not null, bookmarked_count INT not null, position VARCHAR(255) not null, + update_order TIMESTAMP(6) not null, created_at TIMESTAMP(6) not null, updated_at TIMESTAMP(6) not null ); diff --git a/gallery/src/main/kotlin/me/nalab/gallery/domain/Gallery.kt b/gallery/src/main/kotlin/me/nalab/gallery/domain/Gallery.kt index c34edea8..a61000f5 100644 --- a/gallery/src/main/kotlin/me/nalab/gallery/domain/Gallery.kt +++ b/gallery/src/main/kotlin/me/nalab/gallery/domain/Gallery.kt @@ -1,11 +1,8 @@ package me.nalab.gallery.domain import me.nalab.core.data.common.TimeBaseEntity -import javax.persistence.Column -import javax.persistence.Embedded -import javax.persistence.Entity -import javax.persistence.Id -import javax.persistence.Table +import java.time.Instant +import javax.persistence.* @Entity @Table(name = "gallery") @@ -19,4 +16,7 @@ class Gallery( @Embedded val survey: Survey, + + @Column(name = "update_order", columnDefinition = "TIMESTAMP(6)", nullable = false) + private var updateOrder: Instant, ) : TimeBaseEntity()