From d219f6549edcae50061a5a9ff8fee5894d752702 Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Wed, 2 Sep 2020 11:40:34 +0530 Subject: [PATCH] Fix missing status column in import that affects auto-migrated installations. In v0.7.0's automatic DB migration, the default value 'enabled' of subscribers.status was missed incorrectly, causing imports to break on auto-upgraded versions. This is now fixed by explictly inserting the status field in CSV imports. --- queries.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/queries.sql b/queries.sql index 2ee40f5..2e7cfe3 100644 --- a/queries.sql +++ b/queries.sql @@ -75,8 +75,8 @@ SELECT id from sub; -- Upserts a subscriber where existing subscribers get their names and attributes overwritten. -- If $6 = true, update values, otherwise, skip. WITH sub AS ( - INSERT INTO subscribers as s (uuid, email, name, attribs) - VALUES($1, $2, $3, $4) + INSERT INTO subscribers as s (uuid, email, name, attribs, status) + VALUES($1, $2, $3, $4, 'enabled') ON CONFLICT (email) DO UPDATE SET name=(CASE WHEN $6 THEN $3 ELSE s.name END),