diff --git a/scripts/seed-database/write/users.sql b/scripts/seed-database/write/users.sql index d814f880fc..adcd172074 100644 --- a/scripts/seed-database/write/users.sql +++ b/scripts/seed-database/write/users.sql @@ -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, @@ -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;