add subdomains table with migration scripts

This commit is contained in:
Johannes Zellner
2018-06-28 19:39:15 +02:00
parent b15029de11
commit c97e8d6bd4
3 changed files with 62 additions and 0 deletions

View File

@@ -185,3 +185,13 @@ CREATE TABLE IF NOT EXISTS mailboxes(
FOREIGN KEY(domain) REFERENCES mail(domain),
UNIQUE (name, domain));
CREATE TABLE IF NOT EXISTS subdomains(
appId VARCHAR(128) NOT NULL,
domain VARCHAR(128) NOT NULL,
subdomain VARCHAR(128) NOT NULL,
type VARCHAR(128) NOT NULL,
FOREIGN KEY(domain) REFERENCES domains(domain),
FOREIGN KEY(appId) REFERENCES apps(id),
UNIQUE (subdomain, domain))
CHARACTER SET utf8 COLLATE utf8_bin;