From 49f4a6517d1ca7d6381cd3417c9205d49d8c298a Mon Sep 17 00:00:00 2001 From: psiddharthdesign <107192927+psiddharthdesign@users.noreply.github.com> Date: Thu, 25 Jul 2024 15:00:15 +0530 Subject: [PATCH] fix / to migrations --- ...20240725092508_edits_to_encrypted_vars.sql | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 supabase/migrations/20240725092508_edits_to_encrypted_vars.sql diff --git a/supabase/migrations/20240725092508_edits_to_encrypted_vars.sql b/supabase/migrations/20240725092508_edits_to_encrypted_vars.sql new file mode 100644 index 00000000..91c81144 --- /dev/null +++ b/supabase/migrations/20240725092508_edits_to_encrypted_vars.sql @@ -0,0 +1,20 @@ +-- Conditionally drop the 'iv' column if it exists +DO $$ +BEGIN + IF EXISTS ( + SELECT FROM information_schema.columns + WHERE table_schema = 'public' + AND table_name = 'encrypted_env_vars' + AND column_name = 'iv' + ) THEN + ALTER TABLE "public"."encrypted_env_vars" DROP COLUMN "iv"; + END IF; +END $$; + +-- Change the data type of 'encrypted_value' to text +ALTER TABLE "public"."encrypted_env_vars" +ALTER COLUMN "encrypted_value" TYPE text USING encrypted_value::text; + +-- Set the default value for 'encrypted_value' +ALTER TABLE "public"."encrypted_env_vars" +ALTER COLUMN "encrypted_value" SET DEFAULT ''; \ No newline at end of file