Skip to content

Commit

Permalink
fix / to migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
psiddharthdesign committed Jul 25, 2024
1 parent afcc27c commit 49f4a65
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions supabase/migrations/20240725092508_edits_to_encrypted_vars.sql
Original file line number Diff line number Diff line change
@@ -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 '';

0 comments on commit 49f4a65

Please sign in to comment.