Skip to content

Commit

Permalink
chore: Update sync script [skip pizza]
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Feb 12, 2024
1 parent 9625fd4 commit b565f35
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/seed-database/write/team_integrations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,28 @@ CREATE TEMPORARY TABLE sync_team_integrations (
id serial,
team_id integer,
staging_bops_submission_url text,
staging_bops_secret text
staging_bops_secret text,
has_planning_data boolean
);

\COPY sync_team_integrations FROM '/tmp/team_integrations.csv' WITH (FORMAT csv, DELIMITER ';');

INSERT INTO
team_integrations (id, team_id, staging_bops_submission_url, staging_bops_secret)
team_integrations (id, team_id, staging_bops_submission_url, staging_bops_secret, has_planning_data)
SELECT
id,
team_id,
staging_bops_submission_url,
staging_bops_secret
staging_bops_secret,
has_planning_data
FROM
sync_team_integrations ON CONFLICT (id) DO
UPDATE
SET
team_id = EXCLUDED.team_id,
staging_bops_submission_url = EXCLUDED.staging_bops_submission_url,
staging_bops_secret = EXCLUDED.staging_bops_secret;
staging_bops_secret = EXCLUDED.staging_bops_secret,
has_planning_data = EXCLUDED.has_planning_data;
SELECT
setval('team_integrations_id_seq', max(id))
FROM
Expand Down

0 comments on commit b565f35

Please sign in to comment.