2020-03-04 17:22:58 +00:00
|
|
|
CREATE TABLE User (
|
|
|
|
username VARCHAR(255) PRIMARY KEY,
|
2020-03-12 14:23:46 +00:00
|
|
|
password VARCHAR(255) NOT NULL
|
2020-03-04 17:22:58 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE Network (
|
|
|
|
id INTEGER PRIMARY KEY,
|
2020-03-18 02:13:26 +00:00
|
|
|
name VARCHAR(255),
|
2020-03-04 17:22:58 +00:00
|
|
|
user VARCHAR(255) NOT NULL,
|
|
|
|
addr VARCHAR(255) NOT NULL,
|
|
|
|
nick VARCHAR(255) NOT NULL,
|
|
|
|
username VARCHAR(255),
|
|
|
|
realname VARCHAR(255),
|
2020-03-13 11:06:02 +00:00
|
|
|
pass VARCHAR(255),
|
2020-03-13 14:12:44 +00:00
|
|
|
sasl_mechanism VARCHAR(255),
|
|
|
|
sasl_plain_username VARCHAR(255),
|
|
|
|
sasl_plain_password VARCHAR(255),
|
2020-03-12 14:33:49 +00:00
|
|
|
FOREIGN KEY(user) REFERENCES User(username),
|
|
|
|
UNIQUE(user, addr, nick)
|
2020-03-04 17:22:58 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE Channel (
|
|
|
|
id INTEGER PRIMARY KEY,
|
|
|
|
network INTEGER NOT NULL,
|
|
|
|
name VARCHAR(255) NOT NULL,
|
2020-03-13 11:30:01 +00:00
|
|
|
key VARCHAR(255),
|
2020-03-12 14:33:49 +00:00
|
|
|
FOREIGN KEY(network) REFERENCES Network(id),
|
|
|
|
UNIQUE(network, name)
|
2020-03-04 17:22:58 +00:00
|
|
|
);
|