Skip to content

Commit

Permalink
Merge pull request #30 from WomenPlusPlus/fix_migrations
Browse files Browse the repository at this point in the history
Fix migration errors
  • Loading branch information
daczczcz1 authored Oct 18, 2023
2 parents 03f6568 + ff68cf9 commit 6f9f39f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions migrations/V11__add_function_for_storing_user_details.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -54,4 +55,4 @@ where

end;

$ $ LANGUAGE plpgsql;
$$ LANGUAGE plpgsql;
8 changes: 7 additions & 1 deletion migrations/V13__add_column_created_by.sql
Original file line number Diff line number Diff line change
@@ -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);
CONSTRAINT fk_auth_user FOREIGN KEY (created_by) REFERENCES auth.users (id);

0 comments on commit 6f9f39f

Please sign in to comment.