refactor: StoreEntity에 'by' audit 정보 추가

This commit is contained in:
이상진 2025-09-15 15:51:19 +09:00
parent 2d138ff325
commit cdf7a98867
2 changed files with 4 additions and 13 deletions

View File

@ -4,11 +4,8 @@ import jakarta.persistence.Column
import jakarta.persistence.Entity import jakarta.persistence.Entity
import jakarta.persistence.EntityListeners import jakarta.persistence.EntityListeners
import jakarta.persistence.Table import jakarta.persistence.Table
import org.springframework.data.annotation.CreatedDate
import org.springframework.data.annotation.LastModifiedDate
import org.springframework.data.jpa.domain.support.AuditingEntityListener import org.springframework.data.jpa.domain.support.AuditingEntityListener
import roomescape.common.entity.PersistableBaseEntity import roomescape.common.entity.AuditingBaseEntity
import java.time.LocalDateTime
@Entity @Entity
@EntityListeners(AuditingEntityListener::class) @EntityListeners(AuditingEntityListener::class)
@ -29,12 +26,4 @@ class StoreEntity(
val businessRegNum: String, val businessRegNum: String,
val regionCode: String, val regionCode: String,
) : PersistableBaseEntity(id) { ) : AuditingBaseEntity(id)
@CreatedDate
@Column(updatable = false)
lateinit var createdAt: LocalDateTime
@LastModifiedDate
lateinit var updatedAt: LocalDateTime
}

View File

@ -17,7 +17,9 @@ create table if not exists store(
region_code varchar(10) not null, region_code varchar(10) not null,
created_at timestamp not null, created_at timestamp not null,
created_by bigint not null,
updated_at timestamp not null, updated_at timestamp not null,
updated_by bigint not null,
constraint uk_store__name unique (name), constraint uk_store__name unique (name),
constraint uk_store__contact unique (contact), constraint uk_store__contact unique (contact),