CREATE TABLE ACL_SID(ID bigint(20) NOT NULL auto_increment,
PRINCIPAL tinyint(1) NOT NULL,
SID varchar(45) NOT NULL,
constraint UNIQUE_UK_1 unique key(SID,PRINCIPAL)
PRIMARY KEY (`id`)
)
CREATE TABLE ACL_OBJECT_IDENTITY(ID bigint(20) NOT NULL auto_increment,
OBJECT_ID_CLASS bigint(20) NOT NULL,
OBJECT_ID_IDENTITY bigint(20) NOT NULL,
PARENT_OBJECT bigint(20),
OWNER_SID bigint(20),
ENTRIES_INHERITING tinyint(1) NOT NULL,
CONSTRAINT UNIQUE_UK_3 unique key(OBJECT_ID_CLASS,OBJECT_ID_IDENTITY),
CONSTRAINT FOREIGN_FK_1 FOREIGN KEY(PARENT_OBJECT)REFERENCES ACL_OBJECT_IDENTITY(ID),
CONSTRAINT FOREIGN_FK_2 FOREIGN KEY(OBJECT_ID_CLASS)REFERENCES ACL_CLASS(ID),
CONSTRAINT FOREIGN_FK_3 FOREIGN KEY(OWNER_SID)REFERENCES ACL_SID(ID)
PRIMARY KEY (`id`)
)
CREATE TABLE ACL_ENTRY(ID bigint(20) NOT NULL auto_increment,
ACL_OBJECT_IDENTITY BIGINT(20) NOT NULL,
ACE_ORDER INT(11) NOT NULL,
SID BIGINT(20) NOT NULL,
MASK INTEGER NOT NULL,
GRANTING BOOLEAN NOT NULL,AUDIT_SUCCESS BOOLEAN NOT NULL,
AUDIT_FAILURE BOOLEAN NOT NULL,
CONSTRAINT UNIQUE_UK_4 UNIQUE(ACL_OBJECT_IDENTITY,ACE_ORDER),
CONSTRAINT FOREIGN_FK_4 FOREIGN KEY(ACL_OBJECT_IDENTITY) REFERENCES ACL_OBJECT_IDENTITY(ID),
CONSTRAINT FOREIGN_FK_5 FOREIGN KEY(SID) REFERENCES ACL_SID(ID)
PRIMARY KEY (`id`)
)
CREATE TABLE USERS(USERNAME varchar(50) NOT NULL ,
PASSWORD varchar(50) NOT NULL,
ENABLED BOOLEAN NOT NULL
PRIMARY KEY (USERNAME)
)
CREATE TABLE AUTHORITIES(USERNAME varchar(50) NOT NULL,
AUTHORITY varchar(50) NOT NULL,
CONSTRAINT FK_AUTHORITIES_USERS FOREIGN KEY(USERNAME) REFERENCES USERS(USERNAME));
CREATE UNIQUE INDEX IX_AUTH_USERNAME ON AUTHORITIES(USERNAME,AUTHORITY
)
CREATE TABLE CONTACTS(ID BIGINT(20) NOT NULL PRIMARY KEY, CONTACT_NAME varchar(50) NOT NULL,
EMAIL varchar(50) NOT NULL)
PRIMARY KEY (`id`)
CREATE TABLE Productions(ID BIGINT(20) NOT NULL ,
contactid BIGINT(20) NOT NULL,
production_NAME varchar(50) NOT NULL,
EMAIL varchar(50) NOT NULL
PRIMARY KEY (`id`)
)