From e154a28f70e4fb2172b6470a5c55489e4880d1e0 Mon Sep 17 00:00:00 2001 From: johnnyd-eth Date: Mon, 30 Sep 2024 11:19:32 +1000 Subject: [PATCH] fix: conditionally add chain_id col to supabase --- .../20240913212505_project_pv_v4_drop.sql | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/supabase/migrations/20240913212505_project_pv_v4_drop.sql b/supabase/migrations/20240913212505_project_pv_v4_drop.sql index e69b879044..d675183528 100644 --- a/supabase/migrations/20240913212505_project_pv_v4_drop.sql +++ b/supabase/migrations/20240913212505_project_pv_v4_drop.sql @@ -1,14 +1,3 @@ -DO $ -$ -BEGIN - IF NOT EXISTS ( - SELECT 1 - FROM pg_catalog.pg_attribute - WHERE attrelid = 'public.projects'::regclass - AND attname = 'chain_id' - AND NOT attisdropped - ) THEN - ALTER TABLE public.projects ADD COLUMN "chain_id" int; -END -IF; -END $$; +ALTER TABLE public.projects +ADD COLUMN +IF NOT EXISTS "chain_id" int;