Skip to content

Commit 49f4a65

Browse files
fix / to migrations
1 parent afcc27c commit 49f4a65

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
-- Conditionally drop the 'iv' column if it exists
2+
DO $$
3+
BEGIN
4+
IF EXISTS (
5+
SELECT FROM information_schema.columns
6+
WHERE table_schema = 'public'
7+
AND table_name = 'encrypted_env_vars'
8+
AND column_name = 'iv'
9+
) THEN
10+
ALTER TABLE "public"."encrypted_env_vars" DROP COLUMN "iv";
11+
END IF;
12+
END $$;
13+
14+
-- Change the data type of 'encrypted_value' to text
15+
ALTER TABLE "public"."encrypted_env_vars"
16+
ALTER COLUMN "encrypted_value" TYPE text USING encrypted_value::text;
17+
18+
-- Set the default value for 'encrypted_value'
19+
ALTER TABLE "public"."encrypted_env_vars"
20+
ALTER COLUMN "encrypted_value" SET DEFAULT '';

0 commit comments

Comments
 (0)