drop table ACLENTRIES_2;
drop table ACLS_2;
drop table ACLS_WITH_RESOURCE_1;
drop table ALIASES_1;
drop table CATALOGVERSION_2;
drop table COMPLETEDPUBLISHTABLE_2;
drop table COMPLETEDRESULTTABLE_3;
drop table COMPLETEDTABLE_4;
drop table DRESULT_2;
drop table DYNAMICRESULT_1;
drop table EXTENDACLENTRIES_2;
drop table FOLDERS_3;
drop table GROUPPROFILES_1;
drop table GROUPS_1;
drop table GUPROFILES_1;
drop table NODES_3;
drop table REPORTVERSION_2;
drop table RESOURCEMAP_1;
drop table RESOURCENODES_3
drop table RESULTVERSION_2;
drop table RESULT_2;
drop table RGPROFILES_1;
drop table ROLEPROFILES_2;
drop table ROLES_2;
drop table SCHDLASTEXETIME_1;
drop table TBL_IDGENRATOR_JINFONET;
drop table TRIGGERS_1;
drop table UPDATEDETAILS_1;
drop table USERPROFILES_2;
drop table USERS_3;
drop table VERSIONNODES_2;
drop table TASKCONTEXT;
drop table DYNAMICNODE_2;
 
CREATE TABLE TBL_IDGENRATOR_JINFONET (TF_NAME TEXT(64) NOT NULL,NEXT_ID LONG NOT NULL, PRIMARY KEY(TF_NAME));
CREATE TABLE UPDATEDETAILS_1 (UPDATE_ITEM TEXT(32) NOT NULL,UPDATE_STATE INTEGER NOT NULL, PRIMARY KEY(UPDATE_ITEM));
CREATE TABLE NODES_3 (ID LONG NOT NULL,NAME TEXT(64) NOT NULL,CREATORNAME TEXT(32) NOT NULL,CREATETIME DOUBLE NOT NULL,PARENTID LONG NOT NULL,NODETYPE BYTE NOT NULL,ACLID LONG,DESCRIPTION TEXT(255), ENABLELINKEDCAT INTEGER, LINKEDCAT TEXT(255), USEINHERITED INTEGER);
CREATE TABLE FOLDERS_3 (ID LONG NOT NULL,REALPATH TEXT(255),OWNERNAME TEXT(32),MAXVERSIONAMOUNT LONG NOT NULL,ARCHIVENEWVERSION INTEGER NOT NULL,ENABLEARCHIVEPOLICY INTEGER NOT NULL,IS_SHARED INTEGER NOT NULL,ENABLEDYNAMICRESOURCE INTEGER NOT NULL);
CREATE TABLE RESOURCENODES_2 (ID LONG NOT NULL,RESOURCETYPE BYTE NOT NULL,REALPATH TEXT(255),MAXVERSIONAMOUNT LONG NOT NULL,ARCHIVENEWVERSION INTEGER NOT NULL,ENABLEARCHIVEPOLICY INTEGER NOT NULL,PROFILENAME TEXT(255));
CREATE TABLE VERSIONNODES_2 (ID LONG NOT NULL,RESOURCEID LONG NOT NULL,VERSIONNUMBER LONG NOT NULL,EXPIRATIONTIME DOUBLE NOT NULL);
CREATE TABLE ALIASES_1 (ID LONG NOT NULL,PRINCIPAL_NAME TEXT(128) NOT NULL,PRINCIPAL_TYPE BYTE NOT NULL,ALIAS_NAME TEXT(255) NOT NULL,PARENT_NAME TEXT(255),MAP_RESOURCE TEXT(255) NOT NULL,HIDDEN INTEGER NOT NULL, UNIQUE(ID));
CREATE TABLE CATALOGVERSION_2 (VERSIONNUMBER LONG NOT NULL,VERSIONNAME TEXT(128),RESOURCEID LONG NOT NULL,CREATOR TEXT(128),CREATEDTIME DOUBLE NOT NULL,MODIFIER TEXT(128),MODIFIEDTIME DOUBLE NOT NULL,CATALOGFILE TEXT(128) NOT NULL,ID DOUBLE NOT NULL, UNIQUE(ID));
CREATE TABLE REPORTVERSION_2 (VERSIONNUMBER LONG NOT NULL,VERSIONNAME TEXT(128),RESOURCEID LONG NOT NULL,CREATOR TEXT(128),CREATETIME DOUBLE NOT NULL,MODIFIER TEXT(128),MODIFIEDTIME DOUBLE NOT NULL,REPORTFILE TEXT(128) NOT NULL,ID DOUBLE NOT NULL, UNIQUE(RESOURCEID,ID));
CREATE TABLE RESULTVERSION_2 (ID DOUBLE NOT NULL,VERSIONNUMBER LONG NOT NULL,VERSIONNAME TEXT(128) NOT NULL,RESOURCEID LONG NOT NULL,CREATOR TEXT(128),CREATEDTIME DOUBLE NOT NULL,MODIFIER TEXT(128),MODIFIEDTIME DOUBLE NOT NULL,CATALOGVERNUM LONG NOT NULL,CATALOGRESNUM LONG NOT NULL,REPORTVERNUM LONG NOT NULL,REPORTRESNUM LONG NOT NULL,PARAMFILE TEXT(128),RESULTFILE TEXT(128) NOT NULL,RESULTFMTS DOUBLE NOT NULL,LAUNCHTYPE LONG NOT NULL,TASKID TEXT(128),EXPIRATIONTIME DOUBLE NOT NULL,EXPIRE INTEGER NOT NULL,EXPIREATIONMETHOD LONG,SPECIFIEDFOLDER TEXT(128),REPORTAMOUNT LONG, UNIQUE(ID,RESOURCEID));
CREATE TABLE RESULT_2 (RESOURCEID DOUBLE NOT NULL,VERSIONNUMBER DOUBLE NOT NULL,REPORT TEXT(128) NOT NULL,REPORTDISPLAYNAME TEXT(128),RESULT TEXT(128) NOT NULL,VIEWEDFORMATS DOUBLE,PLSRESULTFMTS DOUBLE,SECCONSTRAINTFMTS DOUBLE);
CREATE TABLE DYNAMICNODE_2 (NAME TEXT(128) NOT NULL,ROOT TEXT(128) NOT NULL,REALPATH TEXT(255) NOT NULL,NODETYPE BYTE NOT NULL,ENABLEARCHIVEPOLICY INTEGER NOT NULL,DELETED INTEGER NOT NULL,ACLID LONG,DESCRIPTION TEXT(255),MAXVERSIONAMOUNT LONG, ENABLELINKEDCAT INTEGER, LINKEDCAT TEXT(255), USEINHERITED INTEGER);
CREATE TABLE DYNAMICRESULT_1 (ID LONG NOT NULL,REPORTNAME TEXT(128) NOT NULL,VERSIONNUMBER LONG NOT NULL,CREATOR TEXT(128) NOT NULL,CREATEDTIME DOUBLE NOT NULL,CATALOGVERNUM LONG NOT NULL,CATALOGRESNUM LONG NOT NULL,REPORTVERNUM LONG NOT NULL,REPORTRESNUM LONG NOT NULL,PARAMFILE TEXT(128),RESULTFILE TEXT(128) NOT NULL,RESULTFMTS DOUBLE NOT NULL,LAUNCHTYPE LONG NOT NULL,TASKID TEXT(128),EXPIRATIONTIME DOUBLE NOT NULL,EXPIRE INTEGER NOT NULL,EXPIRATIONMETHOD LONG,REPORTAMOUNT LONG);
CREATE TABLE DRESULT_2 (REPORTSET TEXT(128),VERSIONNUMBER DOUBLE NOT NULL,REPORT TEXT(128) NOT NULL,REPORTDISPLAYNAME TEXT(128),RESULT TEXT(128) NOT NULL,VIEWEDFORMATS DOUBLE,PLSRESULTFMTS DOUBLE,SECCONSTRAINTFMTS DOUBLE);
CREATE TABLE RESOURCEMAP_1 (RESOURCEID LONG NOT NULL,RESOURCENAME TEXT(128) NOT NULL,RESOURCETYPE BYTE NOT NULL);
CREATE TABLE USERS_3 (NAME TEXT(32) NOT NULL,FULL_NAME TEXT(128),DESCRIPTION TEXT(128),EMAIL TEXT(128),CREATE_TIME DOUBLE NOT NULL,USER_PSWD TEXT(128),BUILDIN INTEGER NOT NULL,ENABLE INTEGER NOT NULL,MIN_PS_LENGTH LONG,LAST_MODIFY_TIME DOUBLE,NEVER_EXPIRE INTEGER NOT NULL,EXPIRE_TIME LONG,ACCOUNT_DISABLE INTEGER NOT NULL,ACCESS_EVENT_SUC INTEGER NOT NULL,ACCESS_EVENT_FAIL INTEGER NOT NULL,MANAGEMENT_EVENT_SUC INTEGER NOT NULL,MANAGEMENT_EVENT_FAIL INTEGER NOT NULL,NO_AUDIT INTEGER NOT NULL,AUTH_TYPE LONG NOT NULL,LDAP_TYPE LONG, PRIMARY KEY(NAME));
CREATE TABLE USERPROFILES_2 (USER_NAME TEXT(32),ROLE_NAME TEXT(32));
CREATE TABLE ROLES_2 (NAME TEXT(32) NOT NULL,BUILDIN INTEGER NOT NULL,DESCRIPTION TEXT(32),ROLE_TYPE LONG NOT NULL, PRIMARY KEY(NAME));
CREATE TABLE ACLS_2 (ID LONG NOT NULL,NAME TEXT(64) NOT NULL,CREATE_NAME TEXT(32) NOT NULL,CREATE_TIME DOUBLE, PRIMARY KEY(ID));
CREATE TABLE ACLENTRIES_2 (ENTRY_ID LONG NOT NULL,ACL_ID LONG NOT NULL,PRINCIPAL_TYPE BYTE NOT NULL,PRINCIPAL_NAME TEXT(64) NOT NULL,IS_POSITIVE INTEGER NOT NULL,PERMISSIONS LONG NOT NULL, PRIMARY KEY(ENTRY_ID));
CREATE TABLE ROLEPROFILES_2 (ROLE_NAME TEXT(32),SUB_ROLE_NAME TEXT(32));
CREATE TABLE GROUPS_1 (NAME TEXT(32) NOT NULL,BUILDIN INTEGER NOT NULL,DESCRIPTION TEXT(32),GROUP_TYPE LONG NOT NULL, PRIMARY KEY(NAME));
CREATE TABLE GROUPPROFILES_1 (GROUP_NAME TEXT(32),SUB_GROUP_NAME TEXT(32));
CREATE TABLE RGPROFILES_1 (ROLE_NAME TEXT(32),GROUP_NAME TEXT(32));
CREATE TABLE GUPROFILES_1 (GROUP_NAME TEXT(32),USER_NAME TEXT(32));
CREATE TABLE EXTENDACLENTRIES_2 (PRINCIPAL_NAME TEXT(64) NOT NULL,PRINCIPAL_TYPE BYTE NOT NULL,PERMISSIONS LONG NOT NULL, UNIQUE(PRINCIPAL_NAME,PRINCIPAL_TYPE));
CREATE TABLE COMPLETEDTABLE_4 (ID LONG NOT NULL,RECORDID TEXT(128),TASKID TEXT(128) NOT NULL,TASKCLASS TEXT(255) NOT NULL,CATFILE TEXT(255),RPTFILE TEXT(255),PARAMFILE TEXT(255),RESULTFILE TEXT(255),ERROR TEXT(255),ENGMSG TEXT(255),SUBMITTER TEXT(128),COMPLETEDTIME DOUBLE,FORMATEXISTS LONG,FORMATSUCCESSFUL LONG,VERSIONID LONG,LAUNCHTYPE LONG,ISSUCCESSFUL INTEGER NOT NULL,TASKNAME TEXT(128),ISMISSED INTEGER NOT NULL,SCHEDULETRIGGER TEXT(80),CONDITIONSLOGIC TEXT(16),REPORTNAMES TEXT(255));
CREATE TABLE COMPLETEDPUBLISHTABLE_2 (ID LONG NOT NULL,RECORDID TEXT(40) NOT NULL,SHEETNAME TEXT(255) NOT NULL,DISPLAYNAME TEXT(255),PUB_TYPE TEXT(64) NOT NULL);
CREATE TABLE COMPLETEDRESULTTABLE_3 (PUBLISHID LONG NOT NULL,RECORDID TEXT(40) NOT NULL, PUB_TYPE TEXT(128) NOT NULL,STATUS LONG NOT NULL,DETAIL TEXT(255) NOT NULL);
CREATE TABLE TRIGGERS_1 (TRIGGER_NAME TEXT(80) NOT NULL,DESCRIPTION TEXT(255),TRIGGER_TYPE BYTE NOT NULL,TRIGGER_STATE INTEGER NOT NULL,PREV_FIRE_TIME DOUBLE,NEXT_FIRE_TIME DOUBLE, PRIMARY KEY(TRIGGER_NAME));
CREATE TABLE SCHDLASTEXETIME_1 (TASKID TEXT(40) NOT NULL,LASTEXETIME DOUBLE NOT NULL);
CREATE TABLE ACLS_WITH_RESOURCE_1 (ID LONG NOT NULL,RESOURCE_PATH TEXT(255) NOT NULL,VERSION_NUMBER LONG NOT NULL,ACL_NAME TEXT(64) NOT NULL,CREATE_NAME TEXT(32) NOT NULL,CREATE_TIME DOUBLE, PRIMARY KEY(ID));


CREATE TABLE TASKCONTEXT (ID LONG NOT NULL,VS_RPT_NAME TEXT(255),VI_TSK_TYPE LONG,VI_TSK_STATUS LONG,TS_TSK_SUBMIT DATE,TS_ENG_START DATE,TS_ENG_EXITS DATE,TS_TSK_COMPLETE DATE,TC_TSK_TOTAL DOUBLE,TC_TSK_WAITED DOUBLE,TC_ENG_TOTAL DOUBLE,TC_ENG_LOAD DOUBLE,TC_ENG_EXPORT DOUBLE,TC_ENG_OTHER DOUBLE,TC_TSK_OTHER DOUBLE,NC_RPT_PAGES DOUBLE,NC_RPT_FORMATS DOUBLE,NC_ENG_CONCURRENT DOUBLE,NC_QUE_LENGTH DOUBLE, PRIMARY KEY(ID));


INSERT INTO TBL_IDGENRATOR_JINFONET (TF_NAME,NEXT_ID) VALUES ('NODES_3_ID',0);
INSERT INTO TBL_IDGENRATOR_JINFONET (TF_NAME,NEXT_ID) VALUES ('CATALOGVERSION_2_ID',0);
INSERT INTO TBL_IDGENRATOR_JINFONET (TF_NAME,NEXT_ID) VALUES ('REPORTVERSION_2_ID',0);
INSERT INTO TBL_IDGENRATOR_JINFONET (TF_NAME,NEXT_ID) VALUES ('RESULTVERSION_2_ID',0);
INSERT INTO TBL_IDGENRATOR_JINFONET (TF_NAME,NEXT_ID) VALUES ('ACLS_2_ID',0);
INSERT INTO TBL_IDGENRATOR_JINFONET (TF_NAME,NEXT_ID) VALUES ('ACLENTRIES_2_ENTRY_ID',0);
INSERT INTO TBL_IDGENRATOR_JINFONET (TF_NAME,NEXT_ID) VALUES ('COMPLETEDTABLE_4_ID',0);
INSERT INTO TBL_IDGENRATOR_JINFONET (TF_NAME,NEXT_ID) VALUES ('ACLS_WITH_RESOURCE_1_ID',0);

