Skip to content

Commit

Permalink
Fix missing status column in import that affects auto-migrated
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
knadh committed Sep 2, 2020
1 parent 26390e9 commit d219f65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions queries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit d219f65

Please sign in to comment.