--Order 20015251.70

---WEBUSERGRIDSETTINGS table---
CREATE SEQUENCE SEQ_WEBUSERGRIDSETTINGS
START WITH 1
INCREMENT BY 1;

CREATE TABLE WEBUSERGRIDSETTINGS
(
	WEBUSERGRIDSETTINGS_ID NUMBER NOT NULL ,
	WEBUSER_ID           NUMBER NOT NULL ,
	PAGE                 VARCHAR2(40) NOT NULL ,
	VALUE                CLOB NULL 
);

CREATE UNIQUE INDEX XAK1WEBUSERGRIDSETTINGS ON WEBUSERGRIDSETTINGS
(WEBUSER_ID   ASC,PAGE   ASC);

CREATE INDEX XIF1WEBUSERGRIDSETTINGS ON WEBUSERGRIDSETTINGS
(WEBUSER_ID   ASC);

ALTER TABLE WEBUSERGRIDSETTINGS
ADD CONSTRAINT  XPKWEBUSERGRIDSETTINGS PRIMARY KEY (WEBUSERGRIDSETTINGS_ID);

ALTER TABLE WEBUSERGRIDSETTINGS
ADD CONSTRAINT WEBUSERGRIDSETTINGS_WEBUSER FOREIGN KEY (WEBUSER_ID) REFERENCES WEBUSER (WEBUSER_ID) ON DELETE CASCADE;


---WEBUSERSEARCHSETTINGS table---
CREATE SEQUENCE SEQ_WEBUSERSEARCHSETTINGS
START WITH 1
INCREMENT BY 1;

CREATE TABLE WEBUSERSEARCHSETTINGS
(
	WEBUSERSEARCHSETTINGS_ID NUMBER NOT NULL ,
	WEBUSER_ID           NUMBER NOT NULL ,
	PAGE                 VARCHAR2(30) NOT NULL ,
	PROPERTY             VARCHAR2(50) NOT NULL ,
	VALUE                VARCHAR2(50) NULL 
);


CREATE UNIQUE INDEX XAK1WEBUSERSEARCHSETTINGS ON WEBUSERSEARCHSETTINGS
(WEBUSER_ID   ASC,PAGE   ASC,PROPERTY   ASC);

CREATE INDEX XIF1WEBUSERSEARCHSETTINGS ON WEBUSERSEARCHSETTINGS
(WEBUSER_ID   ASC);

ALTER TABLE WEBUSERSEARCHSETTINGS
ADD CONSTRAINT  XPKWEBUSERSEARCHSETTINGS PRIMARY KEY (WEBUSERSEARCHSETTINGS_ID);

ALTER TABLE WEBUSERSEARCHSETTINGS
ADD CONSTRAINT WEBUSERSEARCHSETTINGS_WEBUSER FOREIGN KEY (WEBUSER_ID) REFERENCES WEBUSER (WEBUSER_ID) ON DELETE CASCADE;