Skip to content

Commit

Permalink
chore: Sync new users.is_staging_only column (#2538)
Browse files Browse the repository at this point in the history
* chore: Sync new users.is_staging_only column [skip pizza]

* fix: Typo
  • Loading branch information
DafyddLlyr authored Dec 6, 2023
1 parent 8ef4c63 commit aa686fb
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions scripts/seed-database/write/users.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ CREATE TEMPORARY TABLE sync_users (
email text,
created_at timestamptz,
updated_at timestamptz,
is_platform_admin boolean
-- ,
-- is_staging_only boolean
is_platform_admin boolean,
is_staging_only boolean
);

\copy sync_users FROM '/tmp/users.csv' WITH (FORMAT csv, DELIMITER ';');
Expand All @@ -23,26 +22,24 @@ INSERT INTO users (
first_name,
last_name,
email,
is_platform_admin
-- ,
-- is_staging_only
is_platform_admin,
is_staging_only
)
SELECT
id,
first_name,
last_name,
email,
is_platform_admin
-- ,
-- is_staging_only
is_platform_admin,
is_staging_only
FROM sync_users
ON CONFLICT (id) DO UPDATE
SET
first_name = EXCLUDED.first_name,
last_name = EXCLUDED.last_name,
email = EXCLUDED.email,
is_platform_admin = EXCLUDED.is_platform_admin;
-- is_staging_only = EXCLUDED.is_staging_only;
is_platform_admin = EXCLUDED.is_platform_admin,
is_staging_only = EXCLUDED.is_staging_only;

ALTER TABLE
users ENABLE TRIGGER grant_new_user_template_team_access;
Expand Down

0 comments on commit aa686fb

Please sign in to comment.