340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
|
db_multi_exec("ALTER TABLE chat ADD COLUMN mdel INT");
}
db_multi_exec("ALTER TABLE chat ADD COLUMN lmtime TEXT");
}
if( !db_table_exists("repository", "chatfts1") ){
db_multi_exec(
"CREATE VIRTUAL TABLE chatfts1 USING fts5("
" xmsg, content=chat, content_rowid=msgid, tokenize=porter"
");"
"CREATE TRIGGER chat_ai AFTER INSERT ON chat BEGIN "
" INSERT INTO chatfts1(rowid, xmsg) VALUES(new.msgid, new.xmsg);"
"END;"
"CREATE TRIGGER chat_ad AFTER DELETE ON chat BEGIN "
" INSERT INTO chatfts1(chatfts1, rowid, xmsg) "
" VALUES('delete', old.msgid, old.xmsg);"
"END;"
"INSERT INTO chatfts1(chatfts1) VALUES('rebuild');"
);
}
}
/*
** Delete old content from the chat table.
*/
|
|
|
|
|
|
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
|
db_multi_exec("ALTER TABLE chat ADD COLUMN mdel INT");
}
db_multi_exec("ALTER TABLE chat ADD COLUMN lmtime TEXT");
}
if( !db_table_exists("repository", "chatfts1") ){
db_multi_exec(
"CREATE VIRTUAL TABLE repository.chatfts1 USING fts5("
" xmsg, content=chat, content_rowid=msgid, tokenize=porter"
");"
"CREATE TRIGGER repository.chat_ai AFTER INSERT ON chat BEGIN "
" INSERT INTO chatfts1(rowid, xmsg) VALUES(new.msgid, new.xmsg);"
"END;"
"CREATE TRIGGER repository.chat_ad AFTER DELETE ON chat BEGIN "
" INSERT INTO chatfts1(chatfts1, rowid, xmsg) "
" VALUES('delete', old.msgid, old.xmsg);"
"END;"
"INSERT INTO repository.chatfts1(chatfts1) VALUES('rebuild');"
);
}
}
/*
** Delete old content from the chat table.
*/
|