summary refs log tree commit diff
path: root/database.h
diff options
context:
space:
mode:
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 (