DROP TABLE IF EXISTS  MWRECON.CHANNEL~
CREATE TABLE MWRECON.CHANNEL (
	CHANNEL_PK VARCHAR(50) NOT NULL,
	CHANNELNAME VARCHAR(50),
	CHANNELSTATUS INTEGER,
	MODIFIED_BY VARCHAR(64) NOT NULL,
	TIMESTAMP TIMESTAMP NOT NULL,
	PRIMARY KEY (CHANNEL_PK)
)~

DROP TABLE IF EXISTS  MWRECON.CHANNELREPORT~
CREATE TABLE MWRECON.CHANNELREPORT (
	CHANNELREPORT_PK INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 NO CYCLE CACHE 20),
	CHANNEL_FK VARCHAR(50) NOT NULL,
	REPORTNAME VARCHAR(255) NOT NULL,
	JRXML VARCHAR(255) NOT NULL,
	TYPE INTEGER NOT NULL,
	MODIFIED_BY VARCHAR(64) NOT NULL,
	TIMESTAMP TIMESTAMP NOT NULL,
	PRIMARY KEY (CHANNELREPORT_PK),
	FOREIGN KEY (CHANNEL_FK) REFERENCES MWRECON.CHANNEL (CHANNEL_PK),
	FOREIGN KEY (TYPE) REFERENCES MWAPP.ATTRIBUTE (ID)
)~

DROP TABLE IF EXISTS  MWRECON.DBCONNECTION~
CREATE TABLE MWRECON.DBCONNECTION (
	DBCONNECTION_PK VARCHAR(50) NOT NULL,
	JDBCDRIVER VARCHAR(100),
	JDBCURL VARCHAR(100),
	LOGINNAME VARCHAR(64),
	PASSWORD VARCHAR(64),
	DSN VARCHAR(50),
	MODIFIED_BY VARCHAR(64) NOT NULL,
	TIMESTAMP TIMESTAMP NOT NULL,
	PRIMARY KEY (DBCONNECTION_PK)
)~

DROP TABLE IF EXISTS  MWRECON.DATAQUERY~
CREATE TABLE MWRECON.DATAQUERY (
	DATAQUERY_PK VARCHAR(50) NOT NULL,
	DBCONNECTION_FK VARCHAR(50),
	QUERYLINE LONG VARCHAR,
	MODIFIED_BY VARCHAR(64) NOT NULL,
	TIMESTAMP TIMESTAMP NOT NULL,
	PRIMARY KEY (DATAQUERY_PK),
	FOREIGN KEY (DBCONNECTION_FK) REFERENCES MWRECON.DBCONNECTION (DBCONNECTION_PK)
)~

DROP TABLE IF EXISTS  MWRECON.RECONPROCESS~
CREATE TABLE MWRECON.RECONPROCESS (
	RECONPROCESS_PK VARCHAR(50) NOT NULL,
	CHANNEL_FK VARCHAR(50),
	PROCESSSEQ INTEGER,
	RECONPROCESS VARCHAR(100),
	STARTRECON VARCHAR(5),
	FILEVIEW VARCHAR(255),
	ISAUTOMATIC CHARACTER(1),
	PRIMARY KEY (RECONPROCESS_PK),
	FOREIGN KEY (CHANNEL_FK) REFERENCES MWRECON.CHANNEL (CHANNEL_PK)
)~

DROP TABLE IF EXISTS  MWRECON.RECONACTION~
CREATE TABLE MWRECON.RECONACTION (
	RECONACTION_PK VARCHAR(50) NOT NULL,
	RECONPROCESS_FK VARCHAR(50),
	RECONSTEP INTEGER,
	RECONTYPE_FK INTEGER,
	SCHEDULETYPE_FK INTEGER,
	RECONDESC VARCHAR(100),
	ACTIONSTATUS INTEGER,
	PRIMARY KEY (RECONACTION_PK),
	FOREIGN KEY (RECONPROCESS_FK) REFERENCES MWRECON.RECONPROCESS (RECONPROCESS_PK),
	FOREIGN KEY (RECONTYPE_FK) REFERENCES MWAPP.ATTRIBUTE (ID),
	FOREIGN KEY (SCHEDULETYPE_FK) REFERENCES MWAPP.ATTRIBUTE (ID)
)~

DROP TABLE IF EXISTS  MWRECON.FILEDB~
CREATE TABLE MWRECON.FILEDB (
	FILEDB_PK INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 NO CYCLE CACHE 20),
	RECONACTION_FK VARCHAR(50) NOT NULL,
	FILENAME VARCHAR(255),
	DATAQUERY_FK VARCHAR(50),
	COLTYPE INTEGER,
	COLS VARCHAR(250),
	STARTROW INTEGER,
	ENDROW INTEGER,
	CUSTOMCLASS VARCHAR(255),
	PRIMARY KEY (FILEDB_PK),
	FOREIGN KEY (RECONACTION_FK) REFERENCES MWRECON.RECONACTION (RECONACTION_PK),
	FOREIGN KEY (DATAQUERY_FK) REFERENCES MWRECON.DATAQUERY (DATAQUERY_PK),
	FOREIGN KEY (COLTYPE) REFERENCES MWAPP.ATTRIBUTE (ID)
)~

DROP TABLE IF EXISTS  MWRECON.FORMATINFO~
CREATE TABLE MWRECON.FORMATINFO (
	FORMATINFO_PK CHAR(2) NOT NULL,
	FORMATINFO VARCHAR(100),
	FORMATDESC VARCHAR(100),
	FORMATSAMPLE VARCHAR(100),
	PRIMARY KEY (FORMATINFO_PK)
)~

DROP TABLE IF EXISTS  MWRECON.PRINTTEXT~
CREATE TABLE MWRECON.PRINTTEXT (
	PRINTTEXT_PK VARCHAR(50) NOT NULL,
	RECONACTION_FK VARCHAR(50),
	PRINTFILENAME VARCHAR(255),
	PRINTDESC VARCHAR(100),
	MODIFIED_BY VARCHAR(64) NOT NULL,
	TIMESTAMP TIMESTAMP NOT NULL,
	TEMPLATE_PATH VARCHAR(256),
	TEMPLATE VARCHAR(256),
	CLASS_TEMPLATE VARCHAR(256),
	PRINTTYPE INTEGER,
	PRIMARY KEY (PRINTTEXT_PK),
	FOREIGN KEY (RECONACTION_FK) REFERENCES MWRECON.RECONACTION (RECONACTION_PK)
)~

DROP TABLE IF EXISTS  MWRECON.PRINTDETAIL~
CREATE TABLE MWRECON.PRINTDETAIL (
	PRINTDETAIL_PK INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 NO CYCLE CACHE 20),
	PRINTTEXT_FK VARCHAR(50),
	LINENUMBER INTEGER,
	LINETYPE CHAR(1),
	LINETEXT VARCHAR(255),
	PRIMARY KEY (PRINTDETAIL_PK),
	FOREIGN KEY (PRINTTEXT_FK) REFERENCES MWRECON.PRINTTEXT (PRINTTEXT_PK)
)~

DROP TABLE IF EXISTS  MWRECON.RECONCOMPARE~
CREATE TABLE MWRECON.RECONCOMPARE (
	RECONCOMPARE_PK INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 NO CYCLE CACHE 20),
	RECONACTION_FK VARCHAR(50),
	COMPARETYPE INTEGER,
	FILENAME1 VARCHAR(255),
	FILENAME2 VARCHAR(255),
	FILERESULT VARCHAR(255),
	COLKEY VARCHAR(100),
	PRIMARY KEY (RECONCOMPARE_PK),
	FOREIGN KEY (RECONACTION_FK) REFERENCES MWRECON.RECONACTION (RECONACTION_PK),
	FOREIGN KEY (COMPARETYPE) REFERENCES MWAPP.ATTRIBUTE (ID)
)~

DROP TABLE IF EXISTS  MWRECON.RECONFTP~
CREATE TABLE MWRECON.RECONFTP (
	RECONFTP_PK INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 NO CYCLE CACHE 20),
	RECONACTION_FK VARCHAR(50),
	FTPTYPE INTEGER,
	FTPIP VARCHAR(20),
	FTPPORT INTEGER,
	FTPFOLDER VARCHAR(100),
	LOCALFOLDER VARCHAR(100),
	FTPFILENAME VARCHAR(255),
	FTPUSERID VARCHAR(64),
	FTPPASSWORD VARCHAR(64),
	FTPPASSIVE SMALLINT,
	FTPLOCATION INTEGER,
	MODIFIED_BY VARCHAR(64) NOT NULL,
	TIMESTAMP TIMESTAMP NOT NULL,
	PRIMARY KEY (RECONFTP_PK),
	FOREIGN KEY (RECONACTION_FK) REFERENCES MWRECON.RECONACTION (RECONACTION_PK),
	FOREIGN KEY (FTPTYPE) REFERENCES MWAPP.ATTRIBUTE (ID)
)~

DROP TABLE IF EXISTS  MWRECON.RECONJOIN~
CREATE TABLE MWRECON.RECONJOIN (
	RECONJOIN_PK INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 NO CYCLE CACHE 20),
	RECONACTION_FK VARCHAR(50),
	FILENAME1 VARCHAR(255),
	FILENAME2 VARCHAR(255),
	FILERESULT VARCHAR(255),
	MODIFIED_BY VARCHAR(64) NOT NULL,
	TIMESTAMP TIMESTAMP NOT NULL,
	PRIMARY KEY (RECONJOIN_PK),
	FOREIGN KEY (RECONACTION_FK) REFERENCES MWRECON.RECONACTION (RECONACTION_PK)
)~

DROP TABLE IF EXISTS  MWRECON.SCHEDULER_PARAMETER~
CREATE TABLE MWRECON.SCHEDULER_PARAMETER (
	CHANNEL VARCHAR(50) NOT NULL,
	PARAMETER VARCHAR(256) NOT NULL,
	SCHEDULER_STATUS VARCHAR(10) NOT NULL,
	SCHEDULER_GET_DAY INTEGER NOT NULL,
	FOREIGN KEY (CHANNEL) REFERENCES MWRECON.CHANNEL (CHANNEL_PK)
)~

DROP TABLE IF EXISTS  MWRECON.TABLEHEADER~
CREATE TABLE MWRECON.TABLEHEADER (
	TABLEHEADER_PK INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 NO CYCLE CACHE 20),
	CHANNEL_FK VARCHAR(50),
	COLUMNNAME CHAR(3),
	COLUMNDESC VARCHAR(100),
	PRIMARY KEY (TABLEHEADER_PK),
	FOREIGN KEY (CHANNEL_FK) REFERENCES MWRECON.CHANNEL (CHANNEL_PK)
)~

DROP TABLE IF EXISTS  MWRECON.UPDATEDB~
CREATE TABLE MWRECON.UPDATEDB (
	UPDATEDB_PK INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 NO CYCLE CACHE 20),
	RECONACTION_FK VARCHAR(50),
	UPDATEDBDESC VARCHAR(100),
	DATAQUERY_FK VARCHAR(50),
	DATAQUERY2_FK VARCHAR(50),
	DATAQUERY3_FK VARCHAR(50),
	UPDATEDBTYPE INTEGER,
	CUSTOMCLASS VARCHAR(256),
	PRIMARY KEY (UPDATEDB_PK),
	FOREIGN KEY (RECONACTION_FK) REFERENCES MWRECON.RECONACTION (RECONACTION_PK),
	FOREIGN KEY (DATAQUERY_FK) REFERENCES MWRECON.DATAQUERY (DATAQUERY_PK),
	FOREIGN KEY (DATAQUERY2_FK) REFERENCES MWRECON.DATAQUERY (DATAQUERY_PK)
)~