Skip to content

Commit

Permalink
expired_at nullable하게 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
k-kbk committed Nov 6, 2023
1 parent 37414d2 commit 5e178dd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ class Banner() : BaseEntity() {
}

@Column(nullable = false)
var expiredAt: Instant = Instant.MIN
var expiredAt: Instant? = null
set(value) {
validateExpiredAt(value)
value?.let {
validateExpiredAt(value)
}
field = value
}

Expand All @@ -63,4 +65,4 @@ class Banner() : BaseEntity() {
const val MAX_LINK_LENGTH = 255
const val MAX_IMAGE_ADDRESS_LENGTH = 255
}
}
}
2 changes: 1 addition & 1 deletion src/main/resources/db/changelog/231016-banner.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CREATE TABLE banner
id bigserial NOT NULL PRIMARY KEY,
link varchar(255) NOT NULL,
image_address varchar(255) NOT NULL,
expired_at timestamp NOT NULL,
expired_at timestamp,
created_at timestamp NOT NULL DEFAULT NOW(),
updated_at timestamp NOT NULL
);
2 changes: 1 addition & 1 deletion src/main/resources/db/changelog/231105-expired_banner.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CREATE TABLE expired_banner
id bigserial NOT NULL PRIMARY KEY,
link varchar(255) NOT NULL,
image_address varchar(255) NOT NULL,
expired_at timestamp NOT NULL,
expired_at timestamp,
created_at timestamp NOT NULL DEFAULT NOW(),
updated_at timestamp NOT NULL
);

0 comments on commit 5e178dd

Please sign in to comment.