Skip to content

Commit

Permalink
fix(sql): set empty string as default compression alg
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Bétrancourt <[email protected]>
  • Loading branch information
rclsilver committed Nov 16, 2022
1 parent 8679f24 commit c303c3b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions sql/migrations/010_fix_resolution_compression_step.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- +migrate Up

UPDATE "resolution" SET "steps_compression_alg" = '' WHERE "steps_compression_alg" IS NULL;

ALTER TABLE "resolution" ALTER COLUMN "steps_compression_alg" SET NOT NULL;
ALTER TABLE "resolution" ALTER COLUMN "steps_compression_alg" SET DEFAULT '';

INSERT INTO "utask_sql_migrations" VALUES ('v1.21.1-migration010');

-- +migrate Down

ALTER TABLE "resolution" ALTER COLUMN "steps_compression_alg" DROP NOT NULL;
ALTER TABLE "resolution" ALTER COLUMN "steps_compression_alg" DROP DEFAULT;

DELETE FROM "utask_sql_migrations" WHERE current_migration_applied = 'v1.21.1-migration010';
2 changes: 1 addition & 1 deletion sql/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ CREATE TABLE "resolution" (
crypt_key BYTEA NOT NULL,
encrypted_resolver_input BYTEA,
encrypted_steps BYTEA NOT NULL,
steps_compression_alg TEXT,
steps_compression_alg TEXT NOT NULL DEFAULT '',
base_configurations JSONB NOT NULL
);

Expand Down

0 comments on commit c303c3b

Please sign in to comment.