/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IFM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_IFM_BIZDEALBILL', 'T_IFM_BIZDEALBILL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_BIZDEALBILL_BILLNO') CREATE INDEX IDX_IFM_BIZDEALBILL_BILLNO ON T_IFM_BIZDEALBILL ( FBILLNO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_BIZDEALBILL_SRCBILLID') CREATE INDEX IDX_IFM_BIZDEALBILL_SRCBILLID ON T_IFM_BIZDEALBILL ( FSOURCEBILLID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_BIZDEALBILL_CENTER') CREATE INDEX IDX_IFM_BIZDEALBILL_CENTER ON T_IFM_BIZDEALBILL ( FSETTLECENTERID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_BIZDEALBILL_ORG') CREATE INDEX IDX_IFM_BIZDEALBILL_ORG ON T_IFM_BIZDEALBILL ( FORGID );


 EXEC P_ALTERPK 'PK_T_IFM_BIZDEALBILL_CA', 'T_IFM_BIZDEALBILL_CA', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_IFM_CURRENTINTBILL', 'T_IFM_CURRENTINTBILL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_CURRENTINTBILL') CREATE INDEX IDX_IFM_CURRENTINTBILL ON T_IFM_CURRENTINTBILL ( FBILLNO );


 EXEC P_ALTERPK 'PK_T_IFM_CURRINTBILL_ENTRY', 'T_IFM_CURRINTBILL_ENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_IFM_INTBILL_BATCH_INT', 'T_IFM_INTBILL_BATCH_INT', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_IFM_INTBILL_BATCH_L', 'T_IFM_INTBILL_BATCH_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_IFM_INTBILL_BATCH', 'T_IFM_INTBILL_BATCH', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_INTBILL_BATCH') CREATE INDEX IDX_IFM_INTBILL_BATCH ON T_IFM_INTBILL_BATCH ( FBILLNO );


 EXEC P_ALTERPK 'PK_T_IFM_BIZDEALBILL_INT', 'T_IFM_BIZDEALBILL_INT', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_IFM_BIZDEALBILL_L', 'T_IFM_BIZDEALBILL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_CFM_FINANCINGVARIETIES_P', 'T_CFM_FINANCINGVARIETIES_P', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CFM_FINANCINGVARIETIES_P') CREATE INDEX IDX_CFM_FINANCINGVARIETIES_P ON T_CFM_FINANCINGVARIETIES_P ( FCATEGORY );



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