mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-10 06:34:41 +02:00
* Minor updates to message base DB scripts
This commit is contained in:
parent
7c0446bf79
commit
aea6782f8c
1 changed files with 17 additions and 1 deletions
|
@ -98,7 +98,7 @@ function createMessageBaseTables() {
|
||||||
' subject,' + // FTS @ message_fts
|
' subject,' + // FTS @ message_fts
|
||||||
' message,' + // FTS @ message_fts
|
' message,' + // FTS @ message_fts
|
||||||
' modified_timestamp DATETIME NOT NULL,' +
|
' modified_timestamp DATETIME NOT NULL,' +
|
||||||
' UNIQUE(message_uuid)' +
|
' UNIQUE(message_uuid),' +
|
||||||
' FOREIGN KEY(area_id) REFERENCES message_area(area_id)' +
|
' FOREIGN KEY(area_id) REFERENCES message_area(area_id)' +
|
||||||
');'
|
');'
|
||||||
);
|
);
|
||||||
|
@ -111,6 +111,22 @@ function createMessageBaseTables() {
|
||||||
');'
|
');'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
dbs.message.run(
|
||||||
|
'CREATE TRIGGER message_before_update BEFORE UPDATE ON message BEGIN' +
|
||||||
|
' DELETE FROM message_fts WHERE docid=old.rowid;' +
|
||||||
|
'END;' +
|
||||||
|
'CREATE TRIGGER message_before_delete BEFORE DELETE ON message BEGIN' +
|
||||||
|
' DELETE FROM message_fts WHERE docid=old.rowid;' +
|
||||||
|
'END;' +
|
||||||
|
'' +
|
||||||
|
'CREATE TRIGGER message_after_update AFTER UPDATE ON message BEGIN' +
|
||||||
|
' INSERT INTO message_fts(docid, subject, message) VALUES(new.rowid, new.subject, new.message);' +
|
||||||
|
'END;' +
|
||||||
|
'CREATE TRIGGER message_after_insert AFTER INSERT ON message BEGIN' +
|
||||||
|
' INSERT INTO message_fts(docid, subject, message) VALUES(new.rowid, new.subject, new.message);' +
|
||||||
|
'END;'
|
||||||
|
);
|
||||||
|
|
||||||
dbs.message.run(
|
dbs.message.run(
|
||||||
'CREATE TABLE IF NOT EXISTS message_meta (' +
|
'CREATE TABLE IF NOT EXISTS message_meta (' +
|
||||||
' message_id INTEGER NOT NULL,' +
|
' message_id INTEGER NOT NULL,' +
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue