/**Begin D:\PDM_UPGRADE\PDM1\fentryid.sql **/

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_DATAGATHERDATA' AND KSQL_COL_NAME IN ('FGLORG')) 
 ALTER TABLE T_EB_DATAGATHERDATA ADD (FGLORG BIGINT DEFAULT 0 NOT NULL );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_EBMEMBERMAP' AND KSQL_COL_NAME IN ('FMOREBUSSDATA')) 
 ALTER TABLE T_EB_EBMEMBERMAP ADD (FMOREBUSSDATA VARCHAR(100) DEFAULT ' ' NOT NULL );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_COLLECTIONCONFIG' AND KSQL_COL_NAME IN ('FSTANDARD')) 
 ALTER TABLE T_EB_COLLECTIONCONFIG ADD (FSTANDARD BIGINT DEFAULT 0 NOT NULL );

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_COLLECTIONCONFIG' AND KSQL_COL_NAME IN ('FACCOUNTFORM')) 
 ALTER TABLE T_EB_COLLECTIONCONFIG ADD (FACCOUNTFORM BIGINT DEFAULT 0 NOT NULL );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_COLLECTIONCONFIG' AND KSQL_COL_NAME IN ('FBOOKTYPE')) 
 ALTER TABLE T_EB_COLLECTIONCONFIG ADD (FBOOKTYPE BIGINT DEFAULT 0 NOT NULL );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_COLLECTIONCONFIG' AND KSQL_COL_NAME IN ('FPERIODTYPE')) 
 ALTER TABLE T_EB_COLLECTIONCONFIG ADD (FPERIODTYPE BIGINT DEFAULT 0 NOT NULL );
 
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_COLLECTIONCFG_ENTITY') 
 CREATE TABLE T_EB_COLLECTIONCFG_ENTITY (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);
 
/**End D:\PDM_UPGRADE\PDM1\EB_constraint.sql **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_WRITEOFFSCHEME' AND KSQL_COL_NAME IN ('FBILL'))
 ALTER TABLE T_EB_WRITEOFFSCHEME ADD (FBILL BIGINT DEFAULT 0 NOT NULL );
