File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff 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 ),
You can’t perform that action at this time.
0 commit comments