--
-- ECMS_AUTH  (Table) 
--
CREATE TABLE ECMS_AUTH
(
  USER_ID  VARCHAR2(50 CHAR),
  AUTH     VARCHAR2(50 CHAR)
)
TABLESPACE NAMO_ED
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          64K
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


--
-- ECMS_ROLE  (Table) 
--
CREATE TABLE ECMS_ROLE
(
  AUTH       VARCHAR2(50 CHAR),
  ROLE_NAME  VARCHAR2(50 CHAR)
)
TABLESPACE NAMO_ED
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          64K
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


--
-- ECMS_ROLE_HIERARCHY  (Table) 
--
CREATE TABLE ECMS_ROLE_HIERARCHY
(
  PARENT_ROLE  VARCHAR2(50 CHAR),
  CHILD_ROLE   VARCHAR2(50 CHAR)
)
TABLESPACE NAMO_ED
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          64K
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


--
-- ECMS_SECURE_RESOURCE  (Table) 
--
CREATE TABLE ECMS_SECURE_RESOURCE
(
  RESOURCE_ID    VARCHAR2(20 CHAR),
  NAME           VARCHAR2(100 CHAR),
  PATTERN        VARCHAR2(255 CHAR),
  DESCRIPTION    VARCHAR2(1000 CHAR),
  RESOURCE_TYPE  VARCHAR2(10 CHAR),
  SORT_ORDER     NUMBER
)
TABLESPACE NAMO_ED
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          64K
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


--
-- ECMS_SECURE_RESOURCE_ROLE  (Table) 
--
CREATE TABLE ECMS_SECURE_RESOURCE_ROLE
(
  RESOURCE_ID  VARCHAR2(20 CHAR),
  AUTH         VARCHAR2(50 CHAR)
)
TABLESPACE NAMO_ED
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          64K
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


--
-- ECMS_AUTH_PK  (Index) 
--
--  Dependencies: 
--   ECMS_AUTH (Table)
--
CREATE UNIQUE INDEX ECMS_AUTH_PK ON ECMS_AUTH
(USER_ID, AUTH)
LOGGING
TABLESPACE NAMO_ED
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          64K
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
           )
NOPARALLEL;


--
-- ECMS_ROLE_HIERARCHY_PK  (Index) 
--
--  Dependencies: 
--   ECMS_ROLE_HIERARCHY (Table)
--
CREATE UNIQUE INDEX ECMS_ROLE_HIERARCHY_PK ON ECMS_ROLE_HIERARCHY
(PARENT_ROLE, CHILD_ROLE)
LOGGING
TABLESPACE NAMO_ED
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          64K
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
           )
NOPARALLEL;


--
-- ECMS_ROLE_PK  (Index) 
--
--  Dependencies: 
--   ECMS_ROLE (Table)
--
CREATE UNIQUE INDEX ECMS_ROLE_PK ON ECMS_ROLE
(AUTH)
LOGGING
TABLESPACE NAMO_ED
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          64K
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
           )
NOPARALLEL;


--
-- ECMS_ROLE_RESOURCE_PK  (Index) 
--
--  Dependencies: 
--   ECMS_SECURE_RESOURCE_ROLE (Table)
--
CREATE UNIQUE INDEX ECMS_ROLE_RESOURCE_PK ON ECMS_SECURE_RESOURCE_ROLE
(AUTH, RESOURCE_ID)
LOGGING
TABLESPACE NAMO_ED
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          64K
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
           )
NOPARALLEL;


--
-- ECMS_SECURE_RESOURCE_PK  (Index) 
--
--  Dependencies: 
--   ECMS_SECURE_RESOURCE (Table)
--
CREATE UNIQUE INDEX ECMS_SECURE_RESOURCE_PK ON ECMS_SECURE_RESOURCE
(RESOURCE_ID)
LOGGING
TABLESPACE NAMO_ED
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          64K
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
           )
NOPARALLEL;


-- 
-- Non Foreign Key Constraints for Table ECMS_AUTH 
-- 
ALTER TABLE ECMS_AUTH ADD (
  CONSTRAINT ECMS_AUTH_PK
 PRIMARY KEY
 (USER_ID, AUTH)
    USING INDEX 
    TABLESPACE NAMO_ED
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       UNLIMITED
                PCTINCREASE      0
               ));

-- 
-- Non Foreign Key Constraints for Table ECMS_ROLE 
-- 
ALTER TABLE ECMS_ROLE ADD (
  CONSTRAINT ECMS_ROLE_PK
 PRIMARY KEY
 (AUTH)
    USING INDEX 
    TABLESPACE NAMO_ED
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       UNLIMITED
                PCTINCREASE      0
               ));

-- 
-- Non Foreign Key Constraints for Table ECMS_ROLE_HIERARCHY 
-- 
ALTER TABLE ECMS_ROLE_HIERARCHY ADD (
  CONSTRAINT ECMS_ROLE_HIERARCHY_PK
 PRIMARY KEY
 (PARENT_ROLE, CHILD_ROLE)
    USING INDEX 
    TABLESPACE NAMO_ED
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       UNLIMITED
                PCTINCREASE      0
               ));

-- 
-- Non Foreign Key Constraints for Table ECMS_SECURE_RESOURCE 
-- 
ALTER TABLE ECMS_SECURE_RESOURCE ADD (
  CONSTRAINT ECMS_SECURE_RESOURCE_PK
 PRIMARY KEY
 (RESOURCE_ID)
    USING INDEX 
    TABLESPACE NAMO_ED
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       UNLIMITED
                PCTINCREASE      0
               ));

-- 
-- Non Foreign Key Constraints for Table ECMS_SECURE_RESOURCE_ROLE 
-- 
ALTER TABLE ECMS_SECURE_RESOURCE_ROLE ADD (
  CONSTRAINT ECMS_ROLE_RESOURCE_PK
 PRIMARY KEY
 (AUTH, RESOURCE_ID)
    USING INDEX 
    TABLESPACE NAMO_ED
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       UNLIMITED
                PCTINCREASE      0
               ));

