/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FMM_constraint.sql **/
 EXEC P_ALTERPK 'PK_FMM_OVERHAULCUSTOMER', 'T_FMM_OVERHAULCUSTOMER', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_OVERHAULCUSTOMER') CREATE INDEX IDX_FMM_OVERHAULCUSTOMER ON T_FMM_OVERHAULCUSTOMER ( FID );


 EXEC P_ALTERPK 'PK_FMM_OVERHAULSCHEME', 'T_FMM_OVERHAULSCHEME', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_OVERHAULSCHEME') CREATE INDEX IDX_FMM_OVERHAULSCHEME ON T_FMM_OVERHAULSCHEME ( FMATERIELID ,FPRODUCTMODEL );


 EXEC P_ALTERPK 'PK_FMM_OVERHAULSCHEME_L', 'T_FMM_OVERHAULSCHEME_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_OVERHAULSCHEME_L') CREATE INDEX IDX_FMM_OVERHAULSCHEME_L ON T_FMM_OVERHAULSCHEME_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_FMM_OVERHAULSCHEMEENTRY', 'T_FMM_OVERHAULSCHEMEENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_OVERHAULSCHEMEENTRY') CREATE INDEX IDX_FMM_OVERHAULSCHEMEENTRY ON T_FMM_OVERHAULSCHEMEENTRY ( FID );



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