diff --git a/database/upgrades/2019-05-16-message-delete-cascade.go b/database/upgrades/2019-05-16-message-delete-cascade.go index 3fb8513..97ee5c9 100644 --- a/database/upgrades/2019-05-16-message-delete-cascade.go +++ b/database/upgrades/2019-05-16-message-delete-cascade.go @@ -10,8 +10,8 @@ func init() { // SQLite doesn't support constraint updates, but it isn't that careful with constraints anyway. return nil } - res, _ := tx.Query(`SELECT EXISTS(SELECT constraint_name FROM information_schema.table_constraints - WHERE table_name='message' AND constraint_name='message_chat_jid_fkey');`) + res, _ := ctx.db.Query(`SELECT EXISTS(SELECT constraint_name FROM information_schema.table_constraints + WHERE table_name='message' AND constraint_name='message_chat_jid_fkey')`) var exists bool _ = res.Scan(&exists) if exists {