Add ownerId for apps

This tracks who installed the app.
This commit is contained in:
Girish Ramakrishnan
2018-05-13 21:02:57 -07:00
parent 38977858aa
commit dfa318e898
16 changed files with 171 additions and 62 deletions

View File

@@ -86,6 +86,9 @@ CREATE TABLE IF NOT EXISTS apps(
oldConfigJson TEXT, // used to pass old config to apptask (configure, restore)
updateConfigJson TEXT, // used to pass new config to apptask (update)
ownerId VARCHAR(128),
FOREIGN KEY(ownerId) REFERENCES users(id),
FOREIGN KEY(domain) REFERENCES domains(domain),
PRIMARY KEY(id));
@@ -143,6 +146,10 @@ CREATE TABLE IF NOT EXISTS domains(
configJson TEXT, /* JSON containing the dns backend provider config */
tlsConfigJson TEXT, /* JSON containing the tls provider config */
ownerId VARCHAR(128),
FOREIGN KEY(ownerId) REFERENCES users(id),
PRIMARY KEY (domain))
/* the default db collation is utf8mb4_unicode_ci but for the app table domain constraint we have to use the old one */