summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--database.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/database.h b/database.h
index 038ce70..2481262 100644
--- a/database.h
+++ b/database.h
@@ -177,7 +177,6 @@ static const char *InitSQL = {
 		"target TEXT,"
 		"message TEXT"
 	");"
-	// TODO: Create other indexes on events?
 	"CREATE VIRTUAL TABLE search USING fts5 ("
 		"message,"
 		"content = events,"
@@ -187,6 +186,10 @@ static const char *InitSQL = {
 	"CREATE TRIGGER eventsInsert AFTER INSERT ON events BEGIN"
 	" INSERT INTO search (rowid, message) VALUES (new.id, new.message);"
 	"END;"
+	"CREATE TRIGGER eventsDelete AFTER DELETE ON events BEGIN"
+	" INSERT INTO search (search, rowid, message)"
+	" VALUES ('delete', old.id, old.message);"
+	"END;"
 	"COMMIT TRANSACTION;"
 };
 
td>June McEnroe 2020-02-11Move hash to top of chat.hJune McEnroe 2020-02-11Move base64 out of chat.hJune McEnroe 2020-02-11Move XDG_SUBDIR out of chat.hJune McEnroe 2020-02-11Fix whois idle unit calculationJune McEnroe Rookie mistake. 2020-02-11Cast towupper to wchar_tJune McEnroe For some reason it takes and returns wint_t... 2020-02-11Cast set but unused variables to voidJune McEnroe 2020-02-11Declare strlcatJune McEnroe 2020-02-11Check if VDSUSP existsJune McEnroe 2020-02-11Fix completeReplace iterationJune McEnroe 2020-02-11Use pkg(8) to configure on FreeBSDJune McEnroe 2020-02-11Remove legacy codeJune McEnroe 2020-02-11Add INSTALLING section to READMEJune McEnroe