/**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_OVERHAULENTRYRULE') 
 CREATE TABLE T_FMM_OVERHAULENTRYRULE (
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_OVERHAULSCHEME' AND KSQL_COL_NAME ='FMRTYPEID') 
 ALTER TABLE T_FMM_OVERHAULSCHEME ADD (FMRTYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FMM_DEFECTTYPE' AND KSQL_COL_NAME ='FPROFESSIONAID') 
 ALTER TABLE T_FMM_DEFECTTYPE ADD (FPROFESSIONAID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FMM_DISPOSALMEASURES' AND KSQL_COL_NAME ='FPROFESSIONAID') 
 ALTER TABLE T_FMM_DISPOSALMEASURES ADD (FPROFESSIONAID BIGINT DEFAULT 0 NOT NULL );

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