Skip to content

Commit

Permalink
fix: add submission_email to team_settings seed script (#3571)
Browse files Browse the repository at this point in the history
  • Loading branch information
RODO94 authored Aug 27, 2024
1 parent effb072 commit 5c486cc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/seed-database/write/team_settings.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ CREATE TEMPORARY TABLE sync_team_settings (
external_planning_site_url text,
external_planning_site_name text,
boundary_url text,
boundary_bbox jsonb
boundary_bbox jsonb,
submission_email text
);

\copy sync_team_settings FROM '/tmp/team_settings.csv' WITH (FORMAT csv, DELIMITER ';');
Expand All @@ -29,7 +30,8 @@ INSERT INTO
external_planning_site_url,
external_planning_site_name,
boundary_url,
boundary_bbox
boundary_bbox,
submission_email
)
SELECT
id,
Expand All @@ -43,7 +45,8 @@ SELECT
external_planning_site_url,
external_planning_site_name,
boundary_url,
boundary_bbox
boundary_bbox,
submission_email
FROM
sync_team_settings ON CONFLICT (id) DO
UPDATE
Expand All @@ -58,7 +61,8 @@ SET
external_planning_site_url = EXCLUDED.external_planning_site_url,
external_planning_site_name = EXCLUDED.external_planning_site_name,
boundary_url = EXCLUDED.boundary_url,
boundary_bbox = EXCLUDED.boundary_bbox;
boundary_bbox = EXCLUDED.boundary_bbox,
submission_email = EXCLUDED.submission_email;
SELECT
setval('team_settings_id_seq', max(id))
FROM
Expand Down

0 comments on commit 5c486cc

Please sign in to comment.