Skip to content

Commit efafcbd

Browse files
committed
update migration to not delete the backed-up code column.
let's do this in a few weeks, once we're confident that everything works.
1 parent 5e76174 commit efafcbd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/migrations/20250728_01_Q3jso-fix-code-table.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,16 @@ def convert_bytea_to_text(conn):
7878
# run the conversion
7979
step(convert_code_to_bytea, convert_bytea_to_text),
8080
# clean up the table and reintroduce hashes
81+
# ALTER TABLE leaderboard.code_files DROP COLUMN old_code;
82+
# do this later, once we're confident that the migration works
8183
step(
8284
"""
83-
ALTER TABLE leaderboard.code_files DROP COLUMN old_code;
85+
ALTER TABLE leaderboard.code_files ALTER COLUMN old_code DROP NOT NULL;
8486
ALTER TABLE leaderboard.code_files ADD COLUMN hash TEXT
8587
GENERATED ALWAYS AS (encode(sha256(code), 'hex')) STORED NOT NULL UNIQUE;
8688
ALTER TABLE leaderboard.code_files ALTER COLUMN code DROP DEFAULT;
8789
""",
8890
"""
89-
ALTER TABLE leaderboard.code_files ADD COLUMN old_code TEXT;
9091
ALTER TABLE leaderboard.code_files DROP COLUMN hash;
9192
""",
9293
),

0 commit comments

Comments
 (0)