diff --git a/pkg/database/migrations/000005_remove_null_from_lists.down.sql b/pkg/database/migrations/000005_remove_null_from_lists.down.sql new file mode 100644 index 0000000..8aebab5 --- /dev/null +++ b/pkg/database/migrations/000005_remove_null_from_lists.down.sql @@ -0,0 +1,6 @@ +BEGIN; + ALTER TABLE messages + ALTER COLUMN previous_content DROP NOT NULL; + ALTER TABLE messages + ALTER COLUMN previous_content DROP DEFAULT; +COMMIT; diff --git a/pkg/database/migrations/000005_remove_null_from_lists.up.sql b/pkg/database/migrations/000005_remove_null_from_lists.up.sql new file mode 100644 index 0000000..a1b8444 --- /dev/null +++ b/pkg/database/migrations/000005_remove_null_from_lists.up.sql @@ -0,0 +1,7 @@ +BEGIN; + UPDATE messages SET previous_content = array[]::varchar[]; + ALTER TABLE messages + ALTER COLUMN previous_content SET NOT NULL; + ALTER TABLE messages + ALTER COLUMN prevous_content SET DEFAULT array[]::varchar[] +COMMIT;