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

 EXEC P_ALTERPK 'PK_T_FMM_CAPACITYGROUP', 'T_FMM_CAPACITYGROUP', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_CAPACITYGROUP_FNUM') CREATE INDEX IDX_FMM_CAPACITYGROUP_FNUM ON T_FMM_CAPACITYGROUP ( FNUMBER );


 EXEC P_ALTERPK 'PK_T_FMM_CAPACITYGROUP_L', 'T_FMM_CAPACITYGROUP_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_FMM_CAPAGROUPTYPE', 'T_FMM_CAPAGROUPTYPE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_CAPAGT_FNUM') CREATE INDEX IDX_FMM_CAPAGT_FNUM ON T_FMM_CAPAGROUPTYPE ( FNUMBER );


 EXEC P_ALTERPK 'PK_T_FMM_CAPAGROUPTYPE_L', 'T_FMM_CAPAGROUPTYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_FMM_CAPAGROUPET', 'T_FMM_CAPAGROUPET', 'FENTRYID', '1';

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



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