Add ON DELETE CASCADE for future sqlite databases too

This commit is contained in:
Tulir Asokan 2019-05-17 13:10:46 +03:00
parent 33148909d6
commit 6cda7ab549

View File

@ -63,7 +63,7 @@ func init() {
content %[1]s NOT NULL, content %[1]s NOT NULL,
PRIMARY KEY (chat_jid, chat_receiver, jid), PRIMARY KEY (chat_jid, chat_receiver, jid),
FOREIGN KEY (chat_jid, chat_receiver) REFERENCES portal(jid, receiver) FOREIGN KEY (chat_jid, chat_receiver) REFERENCES portal(jid, receiver) ON DELETE CASCADE
)`, byteType)) )`, byteType))
if err != nil { if err != nil {
return err return err