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 (