-- ABS-56309/ ABS-58785

-- SYSTEMUSERWEBGRIDSETTINGS table --
CREATE SEQUENCE SEQ_SYSTEMUSERWEBGRIDSETTINGS
START WITH 1
INCREMENT BY 1;

CREATE TABLE SYSTEMUSERWEBGRIDSETTINGS
(
  SYSTEMUSERWEBGRIDSETTINGS_ID NUMBER NOT NULL,
  SYSTEMUSER_ID                NUMBER NOT NULL,
  COMPONENT                    VARCHAR2(50) NOT NULL,
  VALUE                        CLOB NULL
)
;

COMMENT ON COLUMN SYSTEMUSERWEBGRIDSETTINGS.VALUE
  IS 'Xml string';

ALTER TABLE SYSTEMUSERWEBGRIDSETTINGS
  ADD CONSTRAINT XPKSYSTEMUSERWEBGRIDSETTINGS PRIMARY KEY (SYSTEMUSERWEBGRIDSETTINGS_ID);

CREATE UNIQUE INDEX XAK1SYSTEMUSERWEBGRIDSETTINGS ON SYSTEMUSERWEBGRIDSETTINGS (SYSTEMUSER_ID ASC, COMPONENT ASC);
CREATE INDEX XIF1SYSTEMUSERWEBGRIDSETTINGS ON SYSTEMUSERWEBGRIDSETTINGS (SYSTEMUSER_ID ASC);

ALTER TABLE SYSTEMUSERWEBGRIDSETTINGS
  ADD CONSTRAINT SYSTEMUSERWEBGRIDSETTINGS_SU FOREIGN KEY (SYSTEMUSER_ID)
  REFERENCES SYSTEMUSER (SYSTEMUSER_ID) ON DELETE CASCADE;