/**Begin D:\PDM_UPGRADE_1.3\PDM_UPGRADE_1.3\PDM_UPGRADE\PDM1\EB_table.sql **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_CENTRALAPPBILL' AND KSQL_COL_NAME ='FREPORTSCHEME') 
 ALTER TABLE T_EB_CENTRALAPPBILL ADD (FREPORTSCHEME BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_CENTRALAPPBILL' AND KSQL_COL_NAME ='FREPORTENTITY') 
 ALTER TABLE T_EB_CENTRALAPPBILL ADD (FREPORTENTITY BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_CENTRALAPPBILL' AND KSQL_COL_NAME ='FAPPROVEORGID') 
 ALTER TABLE T_EB_CENTRALAPPBILL ADD (FAPPROVEORGID NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_CENTRALSCHEME') 
 CREATE TABLE T_EB_CENTRALSCHEME (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(80) DEFAULT ' ' NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FORGNUMBER BIGINT DEFAULT 0 NOT NULL,
FBIZRANGEID BIGINT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT '0' NOT NULL,
FCREATERID BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYDATE DATETIME,
FSEQ INT DEFAULT 0 NOT NULL,
FACCOUNTNAMES VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYNAMES VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_CENTRALSCHEME_L') 
 CREATE TABLE T_EB_CENTRALSCHEME_L (
FPKID NVARCHAR(20) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(80) DEFAULT ' ' NOT NULL
);



IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_CENTRALSCHEMECHECKER') 
 CREATE TABLE T_EB_CENTRALSCHEMECHECKER (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL,
FPKID BIGINT DEFAULT 0 NOT NULL
);




/**End D:\PDM_UPGRADE_1.3\PDM_UPGRADE_1.3\PDM_UPGRADE\PDM1\EB_table.sql **/
