/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FMM_constraint.sql **/
 EXEC P_ALTERPK 'PK_FMM_ABNORMALREASON', 'T_FMM_ABNORMALREASON', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_FMM_ABNORMALREASON_L', 'T_FMM_ABNORMALREASON_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_FMM_INDUSTRYTIMEREL', 'T_FMM_INDUSTRYTIMEREL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_FMM_INDUSTRYTIMEREL_ORG') CREATE INDEX IDX_T_FMM_INDUSTRYTIMEREL_ORG ON T_FMM_INDUSTRYTIMEREL ( FCREATEORGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_FMM_INDUSTRYTIMEREL_MST') CREATE INDEX IDX_T_FMM_INDUSTRYTIMEREL_MST ON T_FMM_INDUSTRYTIMEREL ( FMASTERID );


 EXEC P_ALTERPK 'PK_FMM_INDUSTRYTIMEREL_L', 'T_FMM_INDUSTRYTIMEREL_L', 'FPKID', '1';

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



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