schema: add UNIQUE constraints
This commit is contained in:
parent
c732b82976
commit
2dfbbf18fd
@ -10,12 +10,14 @@ CREATE TABLE Network (
|
|||||||
nick VARCHAR(255) NOT NULL,
|
nick VARCHAR(255) NOT NULL,
|
||||||
username VARCHAR(255),
|
username VARCHAR(255),
|
||||||
realname VARCHAR(255),
|
realname VARCHAR(255),
|
||||||
FOREIGN KEY(user) REFERENCES User(username)
|
FOREIGN KEY(user) REFERENCES User(username),
|
||||||
|
UNIQUE(user, addr, nick)
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE Channel (
|
CREATE TABLE Channel (
|
||||||
id INTEGER PRIMARY KEY,
|
id INTEGER PRIMARY KEY,
|
||||||
network INTEGER NOT NULL,
|
network INTEGER NOT NULL,
|
||||||
name VARCHAR(255) NOT NULL,
|
name VARCHAR(255) NOT NULL,
|
||||||
FOREIGN KEY(network) REFERENCES Network(id)
|
FOREIGN KEY(network) REFERENCES Network(id),
|
||||||
|
UNIQUE(network, name)
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user