DROP TABLE IF EXISTS MWCONFIG.PRIVILEGE~
CREATE TABLE MWCONFIG.PRIVILEGE (
	ID VARCHAR(256) NOT NULL,
	NAME VARCHAR(256) NOT NULL,
	TYPE VARCHAR(100) NOT NULL,
	PATH VARCHAR(256) NOT NULL,
	PARENT VARCHAR(256),
	PRIORITY INTEGER,
	STATUS VARCHAR(50) NOT NULL,
	MODIFIED_BY VARCHAR(64) NOT NULL,
	TIMESTAMP TIMESTAMP NOT NULL,
	PRIMARY KEY (ID),
	FOREIGN KEY (PARENT) REFERENCES MWCONFIG.PRIVILEGE (ID)
)~

DROP TABLE IF EXISTS MWCONFIG.ROLE~
CREATE TABLE MWCONFIG.ROLE (
	ID VARCHAR(50) NOT NULL,
	-- TYPE VARCHAR(50) NOT NULL,
	NAME VARCHAR(50) NOT NULL,
	STATUS VARCHAR(50) NOT NULL,
	MODIFIED_BY VARCHAR(64) NOT NULL,
	TIMESTAMP TIMESTAMP NOT NULL,
	PRIMARY KEY (ID)
)~

DROP TABLE IF EXISTS MWCONFIG.ROLE_PRIVILEGE~
CREATE TABLE MWCONFIG.ROLE_PRIVILEGE (
	ROLE VARCHAR(50) NOT NULL,
	PRIVILEGE VARCHAR(256) NOT NULL,
	PRIMARY KEY (ROLE,PRIVILEGE),
	FOREIGN KEY (ROLE) REFERENCES MWCONFIG.ROLE (ID),
	FOREIGN KEY (PRIVILEGE) REFERENCES MWCONFIG.PRIVILEGE (ID)
)~