Skip to content

Commit

Permalink
fix: sync all columns in flows table (#3957)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak authored Nov 14, 2024
1 parent 16f38b3 commit 1b02cfd
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions scripts/seed-database/write/flows.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ CREATE TEMPORARY TABLE sync_flows (
copied_from uuid,
analytics_link text,
status text,
name text
name text,
templated_from uuid,
description text
);

\copy sync_flows FROM '/tmp/flows.csv' WITH (FORMAT csv, DELIMITER ';');
Expand All @@ -28,7 +30,9 @@ INSERT INTO flows (
copied_from,
analytics_link,
status,
name
name,
templated_from,
description
)
SELECT
id,
Expand All @@ -41,7 +45,9 @@ SELECT
copied_from,
NULL,
status,
name
name,
templated_from,
description
FROM sync_flows
ON CONFLICT (id) DO UPDATE
SET
Expand All @@ -54,7 +60,9 @@ SET
copied_from = EXCLUDED.copied_from,
analytics_link = NULL,
status = EXCLUDED.status,
name = EXCLUDED.name;
name = EXCLUDED.name,
templated_from = EXCLUDED.templated_from,
description = EXCLUDED.description;

-- ensure that original flows.version is overwritten to match new operation inserted below, else sharedb will fail
UPDATE flows SET version = 1;
Expand Down

0 comments on commit 1b02cfd

Please sign in to comment.