Add mailserver_database tables
This commit is contained in:
parent
ca0577a860
commit
13827e454e
1 changed files with 24 additions and 0 deletions
24
roles/mailserver_database/files/tables.sql
Normal file
24
roles/mailserver_database/files/tables.sql
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
CREATE TABLE IF NOT EXISTS virtual_domains (
|
||||||
|
id integer primary key generated by default as identity,
|
||||||
|
name varchar(50) NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS virtual_users (
|
||||||
|
id integer primary key generated by default as identity,
|
||||||
|
domain_id integer NOT NULL,
|
||||||
|
email varchar(254) NOT NULL,
|
||||||
|
password varchar(150) NOT NULL,
|
||||||
|
quota bigint NOT NULL DEFAULT 0,
|
||||||
|
UNIQUE (email),
|
||||||
|
FOREIGN KEY (domain_id) REFERENCES virtual_domains(id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS virtual_aliases (
|
||||||
|
id integer primary key generated by default as identity,
|
||||||
|
domain_id integer NOT NULL,
|
||||||
|
source varchar(254) NOT NULL,
|
||||||
|
destination varchar(254) NOT NULL,
|
||||||
|
FOREIGN KEY (domain_id) REFERENCES virtual_domains(id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
);
|
Loading…
Reference in a new issue