diff --git a/migrations/V11__add_function_for_storing_user_details.sql b/migrations/V11__add_function_for_storing_user_details.sql index a1763b9..21b03d1 100644 --- a/migrations/V11__add_function_for_storing_user_details.sql +++ b/migrations/V11__add_function_for_storing_user_details.sql @@ -3,7 +3,8 @@ or replace function update_username_and_default_circle ( p_user_id uuid, p_username text, p_default_circle_id int -) returns void as $ $ DECLARE v_default_circle_exists boolean; +) returns void as $$ +DECLARE v_default_circle_exists boolean; BEGIN -- Update username in kpi_user table UPDATE @@ -54,4 +55,4 @@ where end; -$ $ LANGUAGE plpgsql; \ No newline at end of file +$$ LANGUAGE plpgsql; \ No newline at end of file diff --git a/migrations/V13__add_column_created_by.sql b/migrations/V13__add_column_created_by.sql index 744ad10..6b782bb 100644 --- a/migrations/V13__add_column_created_by.sql +++ b/migrations/V13__add_column_created_by.sql @@ -1,9 +1,15 @@ +ALTER TABLE + kpi_definition +DROP + CONSTRAINT IF EXISTS fk_auth_user; + ALTER TABLE kpi_definition ADD COLUMN IF NOT EXISTS created_by uuid; + ALTER TABLE kpi_definition ADD - CONSTRAINT IF NOT EXISTS fk_auth_user FOREIGN KEY (created_by) REFERENCES auth.users (id); \ No newline at end of file + CONSTRAINT fk_auth_user FOREIGN KEY (created_by) REFERENCES auth.users (id); \ No newline at end of file