CREATE TABLE CONF_USER (
  ID number(11) NOT NULL,
  USER_CODE varchar2(32) DEFAULT NULL,
  USER_NAME varchar2(32) NOT NULL,
  PASSWORD varchar2(32) NOT NULL,
  DELETE_FLAG number(1) DEFAULT '0',
  CREATE_TIME date DEFAULT NULL,
  UPDATE_TIME date DEFAULT NULL
);
ALTER TABLE CONF_USER ADD CONSTRAINT PRIMARY_CONF_USER PRIMARY KEY (ID);

CREATE TABLE CONF_PROJECT (
  ID number(11) NOT NULL,
  PROJ_CODE varchar2(32) DEFAULT NULL,
  PROJ_NAME varchar2(32) DEFAULT NULL,
  OWNER_ID number(11) DEFAULT NULL,
  DEVELOPMENT_VERSION number(11) DEFAULT 0  NULL,
  PRODUCTION_VERSION number(11) DEFAULT 0  NULL,
  TEST_VERSION number(11) DEFAULT 0  NULL,
  DELETE_FLAG number(1) DEFAULT '0',
  CREATE_TIME date DEFAULT NULL,
  UPDATE_TIME date DEFAULT NULL
  IS_COMMON number(4) DEFAULT '0' COMMENT '默认不是公共配置项目',
);
ALTER TABLE CONF_PROJECT ADD CONSTRAINT PRIMARY_CONF_PROJECT PRIMARY KEY (ID);

CREATE TABLE CONF_PROJECT_USER (
  PROJ_ID number(11) NOT NULL,
  USER_ID number(11) NOT NULL
) ;
ALTER TABLE CONF_PROJECT_USER ADD CONSTRAINT PRIMARY_CONF_PROJECT_USER PRIMARY KEY (PROJ_ID,USER_ID);

CREATE TABLE CONF_PROJECT_MODULE (
  MODULE_ID number(11) NOT NULL,
  PROJ_ID number(11) NOT NULL,
  MODULE_NAME varchar2(32) DEFAULT NULL
) ;
ALTER TABLE CONF_PROJECT_MODULE ADD CONSTRAINT PRIMARY_CONF_PROJECT_MODULE PRIMARY KEY (MODULE_ID);

CREATE TABLE CONF_PROJECT_USER_ROLE (
  PROJ_ID number(11) NOT NULL,
  USER_ID number(11) NOT NULL,
  ROLE_CODE varchar2(32) NOT NULL
) ;
ALTER TABLE CONF_PROJECT_USER_ROLE ADD CONSTRAINT PRIMARY_CONF_PROJECT_USER_ROLE PRIMARY KEY (PROJ_ID,USER_ID,ROLE_CODE);

CREATE TABLE CONF_PROJECT_CONFIG (
  CONFIG_ID number(11) NOT NULL,
  CONFIG_KEY varchar2(64) NOT NULL,
  CONFIG_VALUE varchar2(256) NOT NULL,
  CONFIG_DESC varchar2(256) DEFAULT NULL,
  PROJECT_ID number(11) NOT NULL,
  MODULE_ID number(11) NOT NULL,
  DELETE_FLAG number(1) DEFAULT '0',
  OPT_USER varchar2(32) DEFAULT NULL,
  OPT_TIME date DEFAULT NULL,
  PRODUCTION_VALUE varchar2(256) NOT NULL,
  PRODUCTION_USER varchar2(32) DEFAULT NULL,
  PRODUCTION_TIME date DEFAULT NULL,
  TEST_VALUE varchar2(256) NOT NULL,
  TEST_USER varchar2(32) DEFAULT NULL,
  TEST_TIME date DEFAULT NULL,
  BUILD_VALUE varchar2(256) NOT NULL,
  BUILD_USER varchar2(32) DEFAULT NULL,
  BUILD_TIME date DEFAULT NULL
  IS_SHOW number(4) DEFAULT '1' COMMENT '默认显示',
) ;
ALTER TABLE CONF_PROJECT_CONFIG ADD CONSTRAINT PRIMARY_CONF_PROJECT_CONFIG PRIMARY KEY (CONFIG_ID);