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

chore: Sync new team_themes columns from production #2664

Merged
merged 1 commit into from
Jan 15, 2024
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
22 changes: 12 additions & 10 deletions scripts/seed-database/write/team_themes.sql
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
-- TODO: Update to add action_color and link_colour columns

-- insert teams_themes overwriting conflicts
CREATE TEMPORARY TABLE sync_team_themes (
id integer,
team_id integer,
primary_colour text,
secondary_colour text,
logo text,
favicon text
favicon text,
link_colour text,
action_colour text
);

\copy sync_team_themes FROM '/tmp/team_themes.csv' WITH (FORMAT csv, DELIMITER ';');
Expand All @@ -17,26 +16,29 @@ INSERT INTO
id,
team_id,
primary_colour,
-- secondary_colour,
logo,
favicon
favicon,
link_colour,
action_colour
)
SELECT
id,
team_id,
primary_colour,
-- secondary_colour,
logo,
favicon
favicon,
link_colour,
action_colour
FROM
sync_team_themes ON CONFLICT (id) DO
UPDATE
SET
team_id = EXCLUDED.team_id,
primary_colour = EXCLUDED.primary_colour,
-- secondary_colour = EXCLUDED.secondary_colour,
logo = EXCLUDED.logo,
favicon = EXCLUDED.favicon;
favicon = EXCLUDED.favicon,
link_colour = EXCLUDED.link_colour,
action_colour = EXCLUDED.action_colour;
SELECT
setval('team_themes_id_seq', max(id))
FROM
Expand Down
Loading