-- =======================================================================
--   DBMS name:      HSQLDB                                               
--   Version:        1.8.0 or higher                                      
--   Notes:          Require max pagesize 16k at least                    
--   Created on:     2016-05-16                                           
-- =======================================================================

-- =======================================================================
--   system database                                                      
-- =======================================================================
DROP TABLE CFG_PROPS_2;
DROP TABLE GLOBAL_NLS_FONT_1;
DROP TABLE GLOBAL_NLS_FORMAT_1;
DROP TABLE GLOBAL_NLS_TEXT_1;
DROP TABLE MEMBERS;
DROP TABLE RESOURCE_LOCK;
DROP TABLE TBL_DUAL_JINFONET;
DROP TABLE TBL_IDGENRATOR_JINFONET;
DROP TABLE TBL_LOCK_JINFONET;
DROP TABLE UPDATEDETAILS_1;
CREATE CACHED TABLE CFG_PROPS_2(PROP_NAME VARCHAR(128) NOT NULL,PROP_KEY VARCHAR(512) NOT NULL,PROP_VALUE VARCHAR(512),IS_LOB BIT NOT NULL,LOB_VAL LONGVARBINARY, PRIMARY KEY(PROP_NAME,PROP_KEY));
CREATE CACHED TABLE GLOBAL_NLS_FONT_1(LOC VARCHAR(10) NOT NULL,ORG_FACE VARCHAR(20) NOT NULL,ORG_SIZE INTEGER NOT NULL,TAR_FACE VARCHAR(20) NOT NULL,TAR_SIZE INTEGER NOT NULL,IS_RELATIVE BIT NOT NULL, PRIMARY KEY(LOC,ORG_FACE,ORG_SIZE));
CREATE CACHED TABLE GLOBAL_NLS_FORMAT_1(LOC VARCHAR(10) NOT NULL,KEY_FORMAT VARCHAR(255) NOT NULL,VALUE_FORMAT VARCHAR(512) NOT NULL, PRIMARY KEY(LOC,KEY_FORMAT));
CREATE CACHED TABLE GLOBAL_NLS_TEXT_1(LOC VARCHAR(10) NOT NULL,NLS_TYPE INTEGER NOT NULL,KEY_TEXT VARCHAR(255) NOT NULL,VALUE_TEXT VARCHAR(512) NOT NULL, PRIMARY KEY(LOC,NLS_TYPE,KEY_TEXT));
CREATE CACHED TABLE MEMBERS(MEMBER_ID INTEGER NOT NULL,RMI_HOST VARCHAR(32) NOT NULL,RMI_PORT INTEGER NOT NULL, PRIMARY KEY(MEMBER_ID));
CREATE CACHED TABLE RESOURCE_LOCK(LOCK_NAME VARCHAR(512) NOT NULL, PRIMARY KEY(LOCK_NAME));
CREATE CACHED TABLE TBL_DUAL_JINFONET(DUAL_COL BIT NOT NULL);
CREATE CACHED TABLE TBL_IDGENRATOR_JINFONET(TF_NAME VARCHAR(64) NOT NULL,NEXT_ID INTEGER NOT NULL, PRIMARY KEY(TF_NAME));
CREATE CACHED TABLE TBL_LOCK_JINFONET(LOCK_NAME VARCHAR(255) NOT NULL, PRIMARY KEY(LOCK_NAME));
CREATE CACHED TABLE UPDATEDETAILS_1(UPDATE_ITEM VARCHAR(32) NOT NULL,UPDATE_STATE BIT NOT NULL, PRIMARY KEY(UPDATE_ITEM));

-- =======================================================================
--   profile database                                                     
-- =======================================================================
DROP TABLE RESOURCE_LOCK;
DROP TABLE TASKAUDIT;
DROP TABLE TASKCONTEXT_2;
DROP TABLE TBL_DUAL_JINFONET;
DROP TABLE TBL_IDGENRATOR_JINFONET;
DROP TABLE TBL_LOCK_JINFONET;
DROP TABLE UPDATEDETAILS_1;
CREATE CACHED TABLE RESOURCE_LOCK(LOCK_NAME VARCHAR(512) NOT NULL, PRIMARY KEY(LOCK_NAME));
CREATE CACHED TABLE TASKAUDIT(ID INTEGER NOT NULL,TASK_ID VARCHAR(128),REPORT_NAME VARCHAR(256),CATALOG_NAME VARCHAR(256),CATALOG_NAMES LONGVARBINARY,USER_NAME VARCHAR(128),TASK_TYPE INTEGER,TASK_STATUS INTEGER,PAGE_NUMBER INTEGER,RUN_TIMES INTEGER,SUBMIT_TIME BIGINT,START_TIME BIGINT,COMPLETE_TIME BIGINT,FAIL_REASON VARCHAR(256),PARAMETERS LONGVARBINARY, PRIMARY KEY(ID));
CREATE CACHED TABLE TASKCONTEXT_2(ID INTEGER NOT NULL,VS_RPT_NAME VARCHAR(255),VI_TSK_TYPE INTEGER,VI_TSK_STATUS INTEGER,TS_TSK_SUBMIT TIMESTAMP,TS_ENG_START TIMESTAMP,TS_ENG_EXITS TIMESTAMP,TS_TSK_COMPLETE TIMESTAMP,TC_TSK_TOTAL BIGINT,TC_TSK_WAITED BIGINT,TC_ENG_TOTAL BIGINT,TC_ENG_LOAD BIGINT,TC_ENG_EXPORT BIGINT,TC_ENG_OTHER BIGINT,TC_TSK_OTHER BIGINT,NC_RPT_PAGES BIGINT,NC_RPT_FORMATS BIGINT,NC_ENG_CONCURRENT BIGINT,NC_QUE_LENGTH BIGINT,TASK_TYPE VARCHAR(16), PRIMARY KEY(ID));
CREATE CACHED TABLE TBL_DUAL_JINFONET(DUAL_COL BIT NOT NULL);
CREATE CACHED TABLE TBL_IDGENRATOR_JINFONET(TF_NAME VARCHAR(64) NOT NULL,NEXT_ID INTEGER NOT NULL, PRIMARY KEY(TF_NAME));
CREATE CACHED TABLE TBL_LOCK_JINFONET(LOCK_NAME VARCHAR(255) NOT NULL, PRIMARY KEY(LOCK_NAME));
CREATE CACHED TABLE UPDATEDETAILS_1(UPDATE_ITEM VARCHAR(32) NOT NULL,UPDATE_STATE BIT NOT NULL, PRIMARY KEY(UPDATE_ITEM));

-- =======================================================================
--   realm database                                                       
-- =======================================================================
DROP TABLE ACLENTRIES_3;
DROP TABLE ACLS_2;
DROP TABLE ACLS_WITH_RESOURCE_1;
DROP TABLE ALIASES_2;
DROP TABLE ALIAS_MAPPING;
DROP TABLE ALIAS_MAPPING_KEY;
DROP TABLE CATALOGVERSION_4;
DROP TABLE CFG_PROPS_2;
DROP TABLE COMPLETEDPUBLISHTABLE_2;
DROP TABLE COMPLETEDRESULTTABLE_3;
DROP TABLE COMPLETEDTABLE_4;
DROP TABLE JR_QRTZ_TRIGGER_LISTENERS;
DROP TABLE JR_QRTZ_SIMPLE_TRIGGERS;
DROP TABLE JR_QRTZ_JOB_LISTENERS;
DROP TABLE JR_QRTZ_CRON_TRIGGERS;
DROP TABLE JR_QRTZ_BLOB_TRIGGERS;
DROP TABLE JR_QRTZ_TRIGGERS;
DROP TABLE JR_QRTZ_JOB_DETAILS;
DROP TABLE DYN_BVELE_NAME_MAPPING_1;
DROP TABLE DYN_BVELE_NAME_1;
DROP TABLE DYNAMIC_CONNECTIONS_MAPPING_2;
DROP TABLE DYNAMIC_CONNECTIONS_2;
DROP TABLE DASHBOARDLISTENERTARGET_1;
DROP TABLE DASHBOARDLISTENER_1;
DROP TABLE CRD_CONN_INFO_1;
DROP TABLE CRDRUNDETAIL_1;
DROP TABLE CRD_INFO_5;
DROP TABLE COMP_CRD_CONN_INFO_1;
DROP TABLE COMPLETED_CRD_INFO_3;
DROP TABLE CUSTOM_FIELD_1;
DROP TABLE CUSTOM_FIELD_VALUE_1;
DROP TABLE DRESULT_3;
DROP TABLE DYNAMICNODE_5;
DROP TABLE DYNAMICRESULT_2;
DROP TABLE DYN_SECURITY_1;
DROP TABLE EXTENDACLENTRIES_3;
DROP TABLE FOLDERS_4;
DROP TABLE GROUPPROFILES_2;
DROP TABLE GROUPS_3;
DROP TABLE GUPROFILES_3;
DROP TABLE HISTORY_PARAMLIST_TABLE_1;
DROP TABLE JR_QRTZ_CALENDARS;
DROP TABLE JR_QRTZ_FIRED_TRIGGERS;
DROP TABLE JR_QRTZ_LOCKS;
DROP TABLE JR_QRTZ_PAUSED_TRIGGER_GRPS;
DROP TABLE JR_QRTZ_SCHEDULER_STATE;
DROP TABLE LCVERSION_2;
DROP TABLE NODES_6;
DROP TABLE ORGANIZATIONS_1;
DROP TABLE REPORTVERSION_4;
DROP TABLE RESOURCEMAP_2;
DROP TABLE RESOURCENLS_1;
DROP TABLE RESOURCENODES_5;
DROP TABLE RESOURCE_LOCK;
DROP TABLE RESULTVERSION_3;
DROP TABLE RESULT_3;
DROP TABLE RGPROFILES_2;
DROP TABLE ROLEPROFILES_3;
DROP TABLE ROLES_4;
DROP TABLE SCHDLASTEXETIME_1;
DROP TABLE STORAGE_MEMBER_1;
DROP TABLE STORAGE_RESOURCE_1;
DROP TABLE TBL_DUAL_JINFONET;
DROP TABLE TBL_IDGENRATOR_JINFONET;
DROP TABLE TBL_LOCK_JINFONET;
DROP TABLE TRIGGERS_1;
DROP TABLE UPDATEDETAILS_1;
DROP TABLE USERPROFILES_4;
DROP TABLE USERS_4;
DROP TABLE VERSIONNODES_3;
CREATE CACHED TABLE ACLENTRIES_3(ENTRY_ID INTEGER NOT NULL,ACL_ID INTEGER NOT NULL,PRINCIPAL_TYPE TINYINT NOT NULL,PRINCIPAL_NAME VARCHAR(256) NOT NULL,IS_POSITIVE BIT NOT NULL,PERMISSIONS INTEGER NOT NULL, PRIMARY KEY(ENTRY_ID));
CREATE CACHED TABLE ACLS_2(ID INTEGER NOT NULL,NAME VARCHAR(64) NOT NULL,CREATE_NAME VARCHAR(32) NOT NULL,CREATE_TIME BIGINT, PRIMARY KEY(ID));
CREATE CACHED TABLE ACLS_WITH_RESOURCE_1(ID INTEGER NOT NULL,RESOURCE_PATH VARCHAR(256) NOT NULL,VERSION_NUMBER INTEGER NOT NULL,ACL_NAME VARCHAR(512) NOT NULL,CREATE_NAME VARCHAR(32) NOT NULL,CREATE_TIME BIGINT, PRIMARY KEY(ID));
CREATE CACHED TABLE ALIASES_2(ID INTEGER NOT NULL,PRINCIPAL_NAME VARCHAR(256) NOT NULL,PRINCIPAL_TYPE TINYINT NOT NULL,ALIAS_NAME VARCHAR(256) NOT NULL,PARENT_NAME VARCHAR(256),MAP_RESOURCE VARCHAR(256) NOT NULL,HIDDEN BIT NOT NULL, UNIQUE(ID));
CREATE CACHED TABLE ALIAS_MAPPING(KEY_ID INTEGER NOT NULL,FIELD_TYPE INTEGER NOT NULL,FIELD_SIGNATURE VARCHAR(32) NOT NULL,FIELD_CATLOG VARCHAR(256) NOT NULL,FIELD_DATASOURCE VARCHAR(256) NOT NULL,FIELD_QUERY VARCHAR(256) NOT NULL,FIELD_DETAILS LONGVARBINARY NOT NULL, PRIMARY KEY(KEY_ID,FIELD_TYPE,FIELD_SIGNATURE));
CREATE CACHED TABLE ALIAS_MAPPING_KEY(ID INTEGER NOT NULL,MAPPING_KEY VARCHAR(256) NOT NULL, PRIMARY KEY(ID), UNIQUE(MAPPING_KEY));
CREATE CACHED TABLE CATALOGVERSION_4(VERSIONNUMBER INTEGER NOT NULL,VERSIONNAME VARCHAR(128),RESOURCEID INTEGER NOT NULL,CREATOR VARCHAR(128),CREATEDTIME BIGINT NOT NULL,MODIFIER VARCHAR(128),MODIFIEDTIME BIGINT NOT NULL,CATALOGFILE VARCHAR(512) NOT NULL,ID BIGINT NOT NULL,DISKSIZE BIGINT, UNIQUE(ID));
CREATE CACHED TABLE CFG_PROPS_2(PROP_NAME VARCHAR(128) NOT NULL,PROP_KEY VARCHAR(512) NOT NULL,PROP_VALUE VARCHAR(512),IS_LOB BIT NOT NULL,LOB_VAL LONGVARBINARY, PRIMARY KEY(PROP_NAME,PROP_KEY));
CREATE CACHED TABLE COMPLETEDPUBLISHTABLE_2(ID INTEGER NOT NULL,RECORDID VARCHAR(40) NOT NULL,SHEETNAME VARCHAR(256) NOT NULL,DISPLAYNAME VARCHAR(256),PUB_TYPE VARCHAR(64) NOT NULL);
CREATE CACHED TABLE COMPLETEDRESULTTABLE_3(PUBLISHID INTEGER NOT NULL,RECORDID VARCHAR(40) NOT NULL,PUB_TYPE VARCHAR(128) NOT NULL,STATUS INTEGER NOT NULL,DETAIL VARCHAR(256) NOT NULL);
CREATE CACHED TABLE COMPLETEDTABLE_4(ID INTEGER NOT NULL,RECORDID VARCHAR(128),TASKID VARCHAR(128) NOT NULL,TASKCLASS VARCHAR(256) NOT NULL,CATFILE VARCHAR(256),RPTFILE VARCHAR(256),PARAMFILE VARCHAR(256),RESULTFILE VARCHAR(1024),ERROR VARCHAR(256),ENGMSG VARCHAR(512),SUBMITTER VARCHAR(128),COMPLETEDTIME BIGINT,FORMATEXISTS INTEGER,FORMATSUCCESSFUL INTEGER,VERSIONID INTEGER,LAUNCHTYPE INTEGER,ISSUCCESSFUL BIT NOT NULL,TASKNAME VARCHAR(128),ISMISSED BIT NOT NULL,SCHEDULETRIGGER VARCHAR(80),CONDITIONSLOGIC VARCHAR(16),REPORTNAMES VARCHAR(512));
CREATE CACHED TABLE COMPLETED_CRD_INFO_3(ID INTEGER NOT NULL,SVERSION INTEGER,CATALOGID INTEGER,CATALOGPATH VARCHAR(255),DATASOURCE VARCHAR(255),QUERYTYPE INTEGER,QUERYNAME VARCHAR(255),LASTMODIFIED BIGINT,USERNAME VARCHAR(255),PWD VARCHAR(255),PARAMFILE VARCHAR(255),LAZY INTEGER,CATALOGVERSION INTEGER,CATALOGLASTMODIFIED BIGINT,STARTTIME BIGINT,COMPLETEDTIME BIGINT,SUCC INTEGER,BVNAME VARCHAR(255),ACTIVITYTYPE TINYINT,MESSAGE VARCHAR(512), UNIQUE(ID));
CREATE CACHED TABLE COMP_CRD_CONN_INFO_1(ID INTEGER,CONNNAME VARCHAR(256),USERNAME VARCHAR(256),PWD VARCHAR(256), FOREIGN KEY (ID) REFERENCES COMPLETED_CRD_INFO_3(ID));
CREATE CACHED TABLE CRD_INFO_5(ID INTEGER NOT NULL,SVERSION INTEGER,CATALOGID INTEGER,CATALOGPATH VARCHAR(255),DATASOURCE VARCHAR(255),QUERYTYPE INTEGER,QUERYNAME VARCHAR(255),LASTMODIFIED BIGINT,USERNAME VARCHAR(255),PWD VARCHAR(255),PARAMFILE VARCHAR(255),LAZY INTEGER,RESULTVERSION INTEGER,CATALOGVERSION INTEGER,CATALOGLASTMODIFIED BIGINT,TASKID VARCHAR(255),CONFIGFILE VARCHAR(255),LOGINUSER VARCHAR(255),CACHETYPE INTEGER,BVNAME VARCHAR(255),STATUS TINYINT,CREATETIME BIGINT,MAXMEMORY DOUBLE,FLAGS INTEGER,LOCATION TINYINT, UNIQUE(ID));
CREATE CACHED TABLE CRDRUNDETAIL_1(ID INTEGER,ACTIVITY TINYINT,STARTTIME BIGINT,ENDTIME BIGINT,SUCC BIT, FOREIGN KEY (ID) REFERENCES CRD_INFO_5(ID));
CREATE CACHED TABLE CRD_CONN_INFO_1(ID INTEGER,CONNNAME VARCHAR(256),USERNAME VARCHAR(256),PWD VARCHAR(256), FOREIGN KEY (ID) REFERENCES CRD_INFO_5(ID));
CREATE CACHED TABLE DASHBOARDLISTENER_1(CLASSNAME VARCHAR(512) NOT NULL,DESCRIPTION VARCHAR(255),ENABLED BOOLEAN NOT NULL,CREATETIME BIGINT, PRIMARY KEY(CLASSNAME));
CREATE CACHED TABLE DASHBOARDLISTENERTARGET_1(CLASSNAME VARCHAR(512),TARGET VARCHAR(512),APPLYTIME BIGINT, FOREIGN KEY (CLASSNAME) REFERENCES DASHBOARDLISTENER_1(CLASSNAME));
CREATE CACHED TABLE DYNAMIC_CONNECTIONS_2(CONN_ID INTEGER NOT NULL,ORG_NAME VARCHAR(256),CATALOG VARCHAR(512) NOT NULL,DATASOURCRE VARCHAR(256) NOT NULL,CONNECTION_NAME VARCHAR(256),CONN_PROPERTIES LONGVARBINARY, PRIMARY KEY(CONN_ID));
CREATE CACHED TABLE DYNAMIC_CONNECTIONS_MAPPING_2(CONN_ID INTEGER NOT NULL,PRINCIPAL VARCHAR(512) NOT NULL,PRINCIPAL_TYPE VARCHAR(64) NOT NULL,DB_USER VARCHAR(256),DB_PASSWORD VARCHAR(256), PRIMARY KEY(CONN_ID,PRINCIPAL,PRINCIPAL_TYPE), FOREIGN KEY (CONN_ID) REFERENCES DYNAMIC_CONNECTIONS_2(CONN_ID));
CREATE CACHED TABLE DYN_BVELE_NAME_1(ID INTEGER NOT NULL,ORG_NAME VARCHAR(256),CATALOG VARCHAR(512) NOT NULL,PRINCIPAL_NAME VARCHAR(512),PRINCIPAL_TYPE VARCHAR(64) NOT NULL, PRIMARY KEY(ID));
CREATE CACHED TABLE DYN_BVELE_NAME_MAPPING_1(ID INTEGER NOT NULL,QUALIFIED_NAME VARCHAR(512) NOT NULL,DISPLAY_NAME VARCHAR(128) NOT NULL, FOREIGN KEY (ID) REFERENCES DYN_BVELE_NAME_1(ID));
CREATE CACHED TABLE JR_QRTZ_JOB_DETAILS(JOB_NAME VARCHAR(200) NOT NULL,JOB_GROUP VARCHAR(200) NOT NULL,DESCRIPTION VARCHAR(250),JOB_CLASS_NAME VARCHAR(250) NOT NULL,IS_DURABLE BIT NOT NULL,IS_VOLATILE BIT NOT NULL,IS_STATEFUL BIT NOT NULL,REQUESTS_RECOVERY BIT NOT NULL,JOB_DATA LONGVARBINARY, PRIMARY KEY(JOB_NAME,JOB_GROUP));
CREATE CACHED TABLE JR_QRTZ_TRIGGERS(TRIGGER_NAME VARCHAR(200) NOT NULL,TRIGGER_GROUP VARCHAR(200) NOT NULL,JOB_NAME VARCHAR(200) NOT NULL,JOB_GROUP VARCHAR(200) NOT NULL,IS_VOLATILE BIT NOT NULL,DESCRIPTION VARCHAR(250),NEXT_FIRE_TIME BIGINT NOT NULL,PREV_FIRE_TIME BIGINT NOT NULL,PRIORITY INTEGER NOT NULL,TRIGGER_STATE VARCHAR(16) NOT NULL,TRIGGER_TYPE VARCHAR(8) NOT NULL,START_TIME BIGINT NOT NULL,END_TIME BIGINT,CALENDAR_NAME VARCHAR(200),MISFIRE_INSTR SMALLINT,JOB_DATA LONGVARBINARY, PRIMARY KEY(TRIGGER_NAME,TRIGGER_GROUP), FOREIGN KEY (JOB_NAME,JOB_GROUP) REFERENCES JR_QRTZ_JOB_DETAILS(JOB_NAME,JOB_GROUP));
CREATE CACHED TABLE JR_QRTZ_BLOB_TRIGGERS(TRIGGER_NAME VARCHAR(200) NOT NULL,TRIGGER_GROUP VARCHAR(200) NOT NULL,BLOB_DATA LONGVARBINARY, PRIMARY KEY(TRIGGER_NAME,TRIGGER_GROUP), FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) REFERENCES JR_QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP));
CREATE CACHED TABLE JR_QRTZ_CRON_TRIGGERS(TRIGGER_NAME VARCHAR(200) NOT NULL,TRIGGER_GROUP VARCHAR(200) NOT NULL,CRON_EXPRESSION VARCHAR(120) NOT NULL,TIME_ZONE_ID VARCHAR(80), PRIMARY KEY(TRIGGER_NAME,TRIGGER_GROUP), FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) REFERENCES JR_QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP));
CREATE CACHED TABLE JR_QRTZ_JOB_LISTENERS(JOB_NAME VARCHAR(200) NOT NULL,JOB_GROUP VARCHAR(200) NOT NULL,JOB_LISTENER VARCHAR(200) NOT NULL, PRIMARY KEY(JOB_NAME,JOB_GROUP,JOB_LISTENER), FOREIGN KEY (JOB_NAME,JOB_GROUP) REFERENCES JR_QRTZ_JOB_DETAILS(JOB_NAME,JOB_GROUP));
CREATE CACHED TABLE JR_QRTZ_SIMPLE_TRIGGERS(TRIGGER_NAME VARCHAR(200) NOT NULL,TRIGGER_GROUP VARCHAR(200) NOT NULL,REPEAT_COUNT BIGINT NOT NULL,REPEAT_INTERVAL BIGINT NOT NULL,TIMES_TRIGGERED BIGINT NOT NULL, PRIMARY KEY(TRIGGER_NAME,TRIGGER_GROUP), FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) REFERENCES JR_QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP));
CREATE CACHED TABLE JR_QRTZ_TRIGGER_LISTENERS(TRIGGER_NAME VARCHAR(200) NOT NULL,TRIGGER_GROUP VARCHAR(200) NOT NULL,TRIGGER_LISTENER VARCHAR(200) NOT NULL, PRIMARY KEY(TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_LISTENER), FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) REFERENCES JR_QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP));
CREATE CACHED TABLE CUSTOM_FIELD_1(ID INTEGER NOT NULL,SVERSION INTEGER,ENABLED INTEGER,NAME VARCHAR(255) NOT NULL,DESCRIPTION VARCHAR(256), UNIQUE(ID,NAME));
CREATE CACHED TABLE CUSTOM_FIELD_VALUE_1(ID INTEGER NOT NULL,SVERSION INTEGER,NODEID INTEGER,NODEREALPATH VARCHAR(256),FIELDID INTEGER,STRINGVALUE VARCHAR(256), UNIQUE(ID));
CREATE CACHED TABLE DRESULT_3(REPORTSET VARCHAR(256),VERSIONNUMBER BIGINT NOT NULL,REPORT VARCHAR(256) NOT NULL,REPORTDISPLAYNAME VARCHAR(256),RESULT VARCHAR(256) NOT NULL,VIEWEDFORMATS BIGINT,PLSRESULTFMTS BIGINT,SECCONSTRAINTFMTS BIGINT);
CREATE CACHED TABLE DYNAMICNODE_5(NAME VARCHAR(256) NOT NULL,ROOT VARCHAR(256) NOT NULL,REALPATH VARCHAR(256) NOT NULL,NODETYPE TINYINT NOT NULL,ENABLEARCHIVEPOLICY BIT NOT NULL,DELETED BIT NOT NULL,ACLID INTEGER,DESCRIPTION VARCHAR(256),MAXVERSIONAMOUNT INTEGER,ENABLELINKEDCAT BIT NOT NULL,LINKEDCAT VARCHAR(256),USEINHERITED BIT NOT NULL,ENABLENLS BIT NOT NULL,STATUS TINYINT,LINKEDCATID INTEGER);
CREATE CACHED TABLE DYNAMICRESULT_2(ID INTEGER NOT NULL,REPORTNAME VARCHAR(256) NOT NULL,VERSIONNUMBER INTEGER NOT NULL,CREATOR VARCHAR(256) NOT NULL,CREATEDTIME BIGINT NOT NULL,CATALOGVERNUM INTEGER NOT NULL,CATALOGRESNUM INTEGER NOT NULL,REPORTVERNUM INTEGER NOT NULL,REPORTRESNUM INTEGER NOT NULL,PARAMFILE VARCHAR(256),RESULTFILE VARCHAR(256) NOT NULL,RESULTFMTS BIGINT NOT NULL,LAUNCHTYPE INTEGER NOT NULL,TASKID VARCHAR(128),EXPIRATIONTIME BIGINT NOT NULL,EXPIRE BIT NOT NULL,EXPIRATIONMETHOD INTEGER,REPORTAMOUNT INTEGER);
CREATE CACHED TABLE DYN_SECURITY_1(ID INTEGER NOT NULL,SVERSION INTEGER,CATALOG_PATH VARCHAR(255),SECURITY_FILE_NAME VARCHAR(255),SECURITY_FILE_PATH VARCHAR(255),TYPE INTEGER, UNIQUE(ID));
CREATE CACHED TABLE EXTENDACLENTRIES_3(PRINCIPAL_NAME VARCHAR(255) NOT NULL,PRINCIPAL_TYPE TINYINT NOT NULL,PERMISSIONS INTEGER NOT NULL, UNIQUE(PRINCIPAL_NAME,PRINCIPAL_TYPE));
CREATE CACHED TABLE FOLDERS_4(ID INTEGER NOT NULL,REALPATH VARCHAR(256),OWNERNAME VARCHAR(256),MAXVERSIONAMOUNT INTEGER NOT NULL,ARCHIVENEWVERSION BIT NOT NULL,ENABLEARCHIVEPOLICY BIT NOT NULL,IS_SHARED BIT NOT NULL,ENABLEDYNAMICRESOURCE BIT NOT NULL);
CREATE CACHED TABLE GROUPPROFILES_2(GROUP_NAME VARCHAR(65),SUB_GROUP_NAME VARCHAR(65));
CREATE CACHED TABLE GROUPS_3(NAME VARCHAR(65) NOT NULL,BUILDIN BIT NOT NULL,DESCRIPTION VARCHAR(256),GROUP_TYPE INTEGER NOT NULL, PRIMARY KEY(NAME));
CREATE CACHED TABLE GUPROFILES_3(GROUP_NAME VARCHAR(65),USER_NAME VARCHAR(256));
CREATE CACHED TABLE HISTORY_PARAMLIST_TABLE_1(ID INTEGER NOT NULL,REALM VARCHAR(256) NOT NULL,USER11 VARCHAR(256) NOT NULL,FILE1 LONGVARBINARY NOT NULL, UNIQUE(ID));
CREATE CACHED TABLE JR_QRTZ_CALENDARS(CALENDAR_NAME VARCHAR(200) NOT NULL,CALENDAR LONGVARBINARY NOT NULL, PRIMARY KEY(CALENDAR_NAME));
CREATE CACHED TABLE JR_QRTZ_FIRED_TRIGGERS(ENTRY_ID VARCHAR(95) NOT NULL,TRIGGER_NAME VARCHAR(200) NOT NULL,TRIGGER_GROUP VARCHAR(200) NOT NULL,IS_VOLATILE BIT NOT NULL,INSTANCE_NAME VARCHAR(200) NOT NULL,FIRED_TIME BIGINT NOT NULL,PRIORITY INTEGER NOT NULL,STATE VARCHAR(16) NOT NULL,JOB_NAME VARCHAR(200),JOB_GROUP VARCHAR(200),IS_STATEFUL BIT,REQUESTS_RECOVERY BIT, PRIMARY KEY(ENTRY_ID));
CREATE CACHED TABLE JR_QRTZ_LOCKS(LOCK_NAME VARCHAR(200) NOT NULL, PRIMARY KEY(LOCK_NAME));
CREATE CACHED TABLE JR_QRTZ_PAUSED_TRIGGER_GRPS(TRIGGER_GROUP VARCHAR(200) NOT NULL, PRIMARY KEY(TRIGGER_GROUP));
CREATE CACHED TABLE JR_QRTZ_SCHEDULER_STATE(INSTANCE_NAME VARCHAR(200) NOT NULL,LAST_CHECKIN_TIME BIGINT NOT NULL,CHECKIN_INTERVAL BIGINT NOT NULL, PRIMARY KEY(INSTANCE_NAME));
CREATE CACHED TABLE LCVERSION_2(VERSIONNUMBER INTEGER NOT NULL,VERSIONNAME VARCHAR(128),RESOURCEID INTEGER NOT NULL,CREATOR VARCHAR(128),CREATEDTIME BIGINT NOT NULL,MODIFIER VARCHAR(128),MODIFIEDTIME BIGINT NOT NULL,LCFILE VARCHAR(512) NOT NULL,ID BIGINT NOT NULL,DISKSIZE BIGINT, UNIQUE(ID));
CREATE CACHED TABLE NODES_6(ID INTEGER NOT NULL,NAME VARCHAR(256) NOT NULL,CREATORNAME VARCHAR(256) NOT NULL,CREATETIME BIGINT NOT NULL,PARENTID INTEGER NOT NULL,NODETYPE TINYINT NOT NULL,ACLID INTEGER,DESCRIPTION VARCHAR(256),ENABLELINKEDCAT BIT,LINKEDCAT VARCHAR(256),USEINHERITED BIT,LINKEDCATID INTEGER,ORGANIZATION VARCHAR(32));
CREATE CACHED TABLE ORGANIZATIONS_1(NAME VARCHAR(32) NOT NULL,DESCRIPTION VARCHAR(256),USERAMOUNT INTEGER, PRIMARY KEY(NAME));
CREATE CACHED TABLE REPORTVERSION_4(VERSIONNUMBER INTEGER NOT NULL,VERSIONNAME VARCHAR(256),RESOURCEID INTEGER NOT NULL,CREATOR VARCHAR(256),CREATETIME BIGINT NOT NULL,MODIFIER VARCHAR(256),MODIFIEDTIME BIGINT NOT NULL,REPORTFILE VARCHAR(512) NOT NULL,ID BIGINT NOT NULL,DISKSIZE BIGINT, UNIQUE(RESOURCEID,ID));
CREATE CACHED TABLE RESOURCEMAP_2(RESOURCEID INTEGER NOT NULL,RESOURCENAME VARCHAR(512) NOT NULL,RESOURCETYPE TINYINT NOT NULL);
CREATE CACHED TABLE RESOURCENLS_1(LOC VARCHAR(10) NOT NULL,FOLDER_ID INTEGER NOT NULL,KEY_TEXT VARCHAR(256) NOT NULL,VALUE_TEXT VARCHAR(512) NOT NULL,ORGANIZATION VARCHAR(32), PRIMARY KEY(LOC,FOLDER_ID,KEY_TEXT));
CREATE CACHED TABLE RESOURCENODES_5(ID INTEGER NOT NULL,RESOURCETYPE TINYINT NOT NULL,REALPATH VARCHAR(256),MAXVERSIONAMOUNT INTEGER NOT NULL,ARCHIVENEWVERSION BIT NOT NULL,ENABLEARCHIVEPOLICY BIT NOT NULL,PROFILENAME VARCHAR(256),ENABLENLS BIT NOT NULL,STATUS TINYINT,RESOURCESUBTYPE TINYINT);
CREATE CACHED TABLE RESOURCE_LOCK(LOCK_NAME VARCHAR(512) NOT NULL, PRIMARY KEY(LOCK_NAME));
CREATE CACHED TABLE RESULTVERSION_3(ID BIGINT NOT NULL,VERSIONNUMBER INTEGER NOT NULL,VERSIONNAME VARCHAR(128) NOT NULL,RESOURCEID INTEGER NOT NULL,CREATOR VARCHAR(128),CREATEDTIME BIGINT NOT NULL,MODIFIER VARCHAR(128),MODIFIEDTIME BIGINT NOT NULL,CATALOGVERNUM INTEGER NOT NULL,CATALOGRESNUM INTEGER NOT NULL,REPORTVERNUM INTEGER NOT NULL,REPORTRESNUM INTEGER NOT NULL,PARAMFILE VARCHAR(128),RESULTFILE VARCHAR(128) NOT NULL,RESULTFMTS BIGINT NOT NULL,LAUNCHTYPE INTEGER NOT NULL,TASKID VARCHAR(128),EXPIRATIONTIME BIGINT NOT NULL,EXPIRE BIT NOT NULL,EXPIREATIONMETHOD INTEGER,SPECIFIEDFOLDER VARCHAR(128),REPORTAMOUNT INTEGER,DISKSIZE BIGINT, UNIQUE(ID,RESOURCEID));
CREATE CACHED TABLE RESULT_3(RESOURCEID BIGINT NOT NULL,VERSIONNUMBER BIGINT NOT NULL,REPORT VARCHAR(256) NOT NULL,REPORTDISPLAYNAME VARCHAR(256),RESULT VARCHAR(256) NOT NULL,VIEWEDFORMATS BIGINT,PLSRESULTFMTS BIGINT,SECCONSTRAINTFMTS BIGINT);
CREATE CACHED TABLE RGPROFILES_2(ROLE_NAME VARCHAR(65),GROUP_NAME VARCHAR(65));
CREATE CACHED TABLE ROLEPROFILES_3(ROLE_NAME VARCHAR(65),SUB_ROLE_NAME VARCHAR(65));
CREATE CACHED TABLE ROLES_4(NAME VARCHAR(65) NOT NULL,BUILDIN BIT NOT NULL,DESCRIPTION VARCHAR(256),ROLE_TYPE INTEGER NOT NULL, PRIMARY KEY(NAME));
CREATE CACHED TABLE SCHDLASTEXETIME_1(TASKID VARCHAR(40) NOT NULL,LASTEXETIME BIGINT NOT NULL);
CREATE CACHED TABLE STORAGE_MEMBER_1(FILEID INTEGER NOT NULL,UNITINDEX INTEGER NOT NULL,BITS BIGINT NOT NULL, UNIQUE(FILEID,UNITINDEX));
CREATE CACHED TABLE STORAGE_RESOURCE_1(ID INTEGER NOT NULL,PATH VARCHAR(255) NOT NULL,ISDIRECTORY BIT NOT NULL,LAST_MODIFIED BIGINT, PRIMARY KEY(ID), UNIQUE(PATH));
CREATE CACHED TABLE TBL_DUAL_JINFONET(DUAL_COL BIT NOT NULL);
CREATE CACHED TABLE TBL_IDGENRATOR_JINFONET(TF_NAME VARCHAR(64) NOT NULL,NEXT_ID INTEGER NOT NULL, PRIMARY KEY(TF_NAME));
CREATE CACHED TABLE TBL_LOCK_JINFONET(LOCK_NAME VARCHAR(255) NOT NULL, PRIMARY KEY(LOCK_NAME));
CREATE CACHED TABLE TRIGGERS_1(TRIGGER_NAME VARCHAR(80) NOT NULL,DESCRIPTION VARCHAR(255),TRIGGER_TYPE TINYINT NOT NULL,TRIGGER_STATE BIT NOT NULL,PREV_FIRE_TIME BIGINT,NEXT_FIRE_TIME BIGINT, PRIMARY KEY(TRIGGER_NAME));
CREATE CACHED TABLE UPDATEDETAILS_1(UPDATE_ITEM VARCHAR(32) NOT NULL,UPDATE_STATE BIT NOT NULL, PRIMARY KEY(UPDATE_ITEM));
CREATE CACHED TABLE USERPROFILES_4(USER_NAME VARCHAR(256),ROLE_NAME VARCHAR(65));
CREATE CACHED TABLE USERS_4(NAME VARCHAR(255) NOT NULL,FULL_NAME VARCHAR(256),DESCRIPTION VARCHAR(256),EMAIL VARCHAR(256),CREATE_TIME BIGINT NOT NULL,USER_PSWD VARCHAR(512),BUILDIN BIT NOT NULL,ENABLE BIT NOT NULL,MIN_PS_LENGTH INTEGER,LAST_MODIFY_TIME BIGINT,NEVER_EXPIRE BIT NOT NULL,EXPIRE_TIME INTEGER,ACCOUNT_DISABLE BIT NOT NULL,ACCESS_EVENT_SUC BIT NOT NULL,ACCESS_EVENT_FAIL BIT NOT NULL,MANAGEMENT_EVENT_SUC BIT NOT NULL,MANAGEMENT_EVENT_FAIL BIT NOT NULL,NO_AUDIT BIT NOT NULL,AUTH_TYPE INTEGER NOT NULL,LDAP_TYPE INTEGER, PRIMARY KEY(NAME));
CREATE CACHED TABLE VERSIONNODES_3(ID INTEGER NOT NULL,RESOURCEID INTEGER NOT NULL,VERSIONNUMBER INTEGER NOT NULL,EXPIRATIONTIME BIGINT NOT NULL,AUTHOR VARCHAR(256),AUTHOREMAIL VARCHAR(256),BUILDINDESC VARCHAR(256));
