Skip to content

Commit 90c0776

Browse files
committed
Make file object key non-nullable
All of the file rows in our production database contain a non-null object key and Parcelo never sets files' object keys to null, so this migration is safe for us to perform.
1 parent 83b741b commit 90c0776

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

console/src/main/kotlin/app/accrescent/parcelo/console/data/File.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import org.jetbrains.exposed.dao.id.IntIdTable
1111

1212
object Files : IntIdTable("files") {
1313
val deleted = bool("deleted").default(false)
14-
val s3ObjectKey = text("s3_object_key").nullable()
14+
val s3ObjectKey = text("s3_object_key")
1515
}
1616

1717
class File(id: EntityID<Int>) : IntEntity(id) {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE files ALTER COLUMN s3_object_key SET NOT NULL;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Copyright 2025 Logan Magee
2+
3+
SPDX-License-Identifier: AGPL-3.0-only

0 commit comments

Comments
 (0)