summary refs log tree commit diff
path: root/database.h
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-12-25 18:08:54 -0500
committerJune McEnroe <june@causal.agency>2019-12-25 18:08:54 -0500
commit5022cfb9ee309475c2110994dfff86a7f32d614e (patch)
treef9d61205194c8546a5a5ec9c99b2ce01e1cd6e1a /database.h
parentInsert MOTDs into the database (diff)
downloadlitterbox-5022cfb9ee309475c2110994dfff86a7f32d614e.tar.gz
litterbox-5022cfb9ee309475c2110994dfff86a7f32d614e.zip
Treat topics like motds
It's more like a cache of existing topics. events is still meant to
record actual topic events.
Diffstat (limited to '')
-rw-r--r--database.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/database.h b/database.h
index fa0dc10..810ce94 100644
--- a/database.h
+++ b/database.h
@@ -226,9 +226,10 @@ static const char *InitSQL = SQL(
 	);
 
 	CREATE TABLE topics (
-		context INTEGER NOT NULL REFERENCES contexts,
 		time DATETIME NOT NULL,
-		topic TEXT
+		context INTEGER NOT NULL REFERENCES contexts,
+		topic TEXT NOT NULL,
+		UNIQUE (context, topic)
 	);
 
 	CREATE TABLE names (