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

fix: Add new flow.status column to sync script #3192

Merged
merged 1 commit into from
May 24, 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
12 changes: 8 additions & 4 deletions scripts/seed-database/write/flows.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ CREATE TEMPORARY TABLE sync_flows (
updated_at timestamptz,
settings jsonb,
copied_from uuid,
analytics_link text
analytics_link text,
status text
);

\copy sync_flows FROM '/tmp/flows.csv' WITH (FORMAT csv, DELIMITER ';');
Expand All @@ -24,7 +25,8 @@ INSERT INTO flows (
version,
settings,
copied_from,
analytics_link
analytics_link,
status
)
SELECT
id,
Expand All @@ -35,7 +37,8 @@ SELECT
version,
settings,
copied_from,
NULL
NULL,
status
FROM sync_flows
ON CONFLICT (id) DO UPDATE
SET
Expand All @@ -46,7 +49,8 @@ SET
version = EXCLUDED.version,
settings = EXCLUDED.settings,
copied_from = EXCLUDED.copied_from,
analytics_link = NULL;
analytics_link = NULL,
status = EXCLUDED.status;

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