Skip to content

Commit

Permalink
#3208: setup_tables.py, create permission tables
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff1evesque committed Mar 23, 2018
1 parent 48a2fc9 commit 6d40474
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions puppet/environment/docker/modules/mariadb/scripts/setup_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,36 @@ class VARCHAR (50) NOT NULL

# general permission
sql_statement = '''\
CREATE TABLE IF NOT EXISTS PermissionUUID (
PermissionID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
PermissionType INT NOT NULL,
);
CREATE TABLE IF NOT EXISTS Permission (
PermissionID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
foreign key (PermissionEntityID) references PermissionEntity(PermissionEntityID),
foreign key (PermissionValueID) references PermissionValue(PermissionEntityID),
foreign key (PermissionValueID) references PermissionValue(PermissionValueID),
foreign key (UserID) references User(UserID),
foreign key (PermissionType) references PermissionUUID(PermissionType),
);
CREATE TABLE IF NOT EXISTS PermissionCollection (
PermissionID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
foreign key (OwnID) references Own(OwnID),
);
CREATE TABLE IF NOT EXISTS PermissionModel (
PermissionID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
foreign key (OwnID) references Own(OwnID),
);
CREATE TABLE IF NOT EXISTS PermissionResult (
PermissionID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
foreign key (OwnID) references Own(OwnID),
);
CREATE TABLE IF NOT EXISTS PermissionValue (
PermissionID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
foreign key (OwnID) references Own(OwnID),
);
'''
cur.execute(sql_statement)
Expand Down

0 comments on commit 6d40474

Please sign in to comment.