/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FMM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FMM_OVERHAULENTRYCUST') 
 CREATE TABLE T_FMM_OVERHAULENTRYCUST (
FPKID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FMM_OVERHAULSCHEMEENTRY' AND KSQL_COL_NAME ='FENTRYMANDATORY') 
 ALTER TABLE T_FMM_OVERHAULSCHEMEENTRY ADD (FENTRYMANDATORY CHAR(1) DEFAULT '1' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FMM_OVERHAULSCHEMEENTRY' AND KSQL_COL_NAME ='FENTRYPRODUCTNCR') 
 ALTER TABLE T_FMM_OVERHAULSCHEMEENTRY ADD (FENTRYPRODUCTNCR CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FMM_OVERHAULSCHEMEENTRY' AND KSQL_COL_NAME ='FENTRYREMARKS') 
 ALTER TABLE T_FMM_OVERHAULSCHEMEENTRY ADD (FENTRYREMARKS VARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FMM_OVERHAULENTRYCHECK') 
 CREATE TABLE T_FMM_OVERHAULENTRYCHECK (
FPKID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);



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