Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Disable grant_new_user_template_team_access trigger on DB sync #2315

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions scripts/seed-database/write/users.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ CREATE TEMPORARY TABLE sync_users (

\copy sync_users FROM '/tmp/users.csv' WITH (FORMAT csv, DELIMITER ';');

-- Do not automatically generate team_member records for the templates team
-- We manually truncate and replace the team_members table in another step
ALTER TABLE
users DISABLE TRIGGER grant_new_user_template_team_access;

INSERT INTO users (
id,
first_name,
Expand All @@ -27,4 +32,7 @@ SELECT
FROM sync_users
ON CONFLICT (id) DO NOTHING;

ALTER TABLE
users ENABLE TRIGGER grant_new_user_template_team_access;

SELECT setval('users_id_seq', max(id)) FROM users;
Loading