add group membership table

This commit is contained in:
girish@cloudron.io
2016-02-08 08:55:37 -08:00
parent 1d83a48a1a
commit e39d7750c5
2 changed files with 28 additions and 0 deletions

View File

@@ -26,6 +26,12 @@ CREATE TABLE IF NOT EXISTS groups(
username VARCHAR(254) NOT NULL UNIQUE,
PRIMARY KEY(id));
CREATE TABLE IF NOT EXISTS groupMembers(
groupId VARCHAR(128) NOT NULL,
userId VARCHAR(128) NOT NULL,
FOREIGN KEY(groupId) REFERENCES groups(id),
FOREIGN KEY(userId) REFERENCES users(id));
CREATE TABLE IF NOT EXISTS tokens(
accessToken VARCHAR(128) NOT NULL UNIQUE,
identifier VARCHAR(128) NOT NULL,