From 05dd01d125fcdd0679cba6b979917364d74b6a51 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Fri, 8 Jan 2021 17:27:15 +0000 Subject: [PATCH] Use _foreign_keys=1 instead of _fk=1 The _foreign_keys=1 syntax is widely supported but the _fk=1 alias for it was only added in version 1.8.0 of the sqlite3 driver. Avoid using the alias for the time being (the freeze is near). Gbp-Pq: Name 0002-add-compatibility-for-older-sqlite-driver.patch --- pkg/database/database.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/database/database.go b/pkg/database/database.go index 2daef7c..ccc9d92 100644 --- a/pkg/database/database.go +++ b/pkg/database/database.go @@ -46,7 +46,7 @@ func NewClient(config *csconfig.DatabaseCfg) (*Client, error) { return &Client{}, fmt.Errorf("unable to set perms on %s: %v", config.DbPath, err) } } - client, err = ent.Open("sqlite3", fmt.Sprintf("file:%s?_busy_timeout=100000&_fk=1", config.DbPath)) + client, err = ent.Open("sqlite3", fmt.Sprintf("file:%s?_busy_timeout=100000&_foreign_keys=1", config.DbPath)) if err != nil { return &Client{}, fmt.Errorf("failed opening connection to sqlite: %v", err) } -- 2.30.2