poll-bugzilla: Avoid adding new task to multiple tables.
[todo.git] / todo-schema.sql
index eb4492b..5c9aeb2 100644 (file)
@@ -49,12 +49,14 @@ create table retired (
 create table tags (
     id serial not null primary key,
     name text not null,
-    colour text not null references colours (colour)
+    colour text not null references colours (colour),
+    unique (name)
 );
 
 create table tags_tasks (
     tagid integer not null references tags (id),
-    taskid integer not null references tasks (id)
+    taskid integer not null references tasks (id),
+    unique (tagid, taskid)
 );
 
 create table colours (