From 221d0d7dbb8f7b09a1feeb1f0ee16e133feadd04 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Mon, 25 Sep 2023 14:25:24 -0400 Subject: [PATCH] Make letters (v13) migration compatible with SQLite --- migrations/v13.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/migrations/v13.go b/migrations/v13.go index cb509f2..b6c6c3a 100644 --- a/migrations/v13.go +++ b/migrations/v13.go @@ -29,16 +29,15 @@ func supportLetters(db *datastore) error { return err } - // TODO: fix for SQLite database _, err = t.Exec(`CREATE TABLE emailsubscribers ( - id char(8) not null, - collection_id int not null, - user_id int null, - email varchar(255) null, - subscribed datetime not null, - token char(16) not null, - confirmed tinyint(1) default 0 not null, - allow_export tinyint(1) default 0 not null, + id ` + db.typeChar(8) + ` not null, + collection_id ` + db.typeInt() + ` not null, + user_id ` + db.typeInt() + ` null, + email ` + db.typeVarChar(255) + ` null, + subscribed ` + db.typeDateTime() + ` not null, + token ` + db.typeChar(16) + ` not null, + confirmed ` + db.typeBool() + ` default 0 not null, + allow_export ` + db.typeBool() + ` default 0 not null, constraint eu_coll_email unique (collection_id, email), constraint eu_coll_user