/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_APPROVEBILL' AND KSQL_COL_NAME ='FAPPINDEXID') 
 ALTER TABLE T_EB_APPROVEBILL ADD (FAPPINDEXID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_BIZRULEGROUP') 
 CREATE TABLE T_EB_BIZRULEGROUP (
FID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMODEL BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_BIZRULEGROUPDIS') 
 CREATE TABLE T_EB_BIZRULEGROUPDIS (
FPKID BIGINT DEFAULT 0 NOT NULL,
FGROUPID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FRULEID BIGINT DEFAULT 0 NOT NULL,
FMODEL BIGINT DEFAULT 0 NOT NULL,
FEXECSEQAUTO NCLOB,
FEXECSEQHANDLE NCLOB
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_BIZRULEFORMULAACC' AND KSQL_COL_NAME ='FISLEFT') 
 ALTER TABLE T_EB_BIZRULEFORMULAACC ADD (FISLEFT CHAR(1) DEFAULT '0' NOT NULL );




/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_table.sql **/
