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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_ACCACC_FSCORGID') CREATE INDEX IDX_IFM_ACCACC_FSCORGID ON T_IFM_ACCOUNTACCEPT ( FSCORGID );


 EXEC P_ALTERPK 'PK_IFM_ACCOUNTACCEPT_CUR', 'T_IFM_ACCOUNTACCEPT_CUR', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_IFM_ACCOUNTACCEPT_L', 'T_IFM_ACCOUNTACCEPT_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_IFM_INNERACCOUNTINIT', 'T_IFM_INNERACCOUNTINIT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_INNACCINIT_FACCID') CREATE INDEX IDX_IFM_INNACCINIT_FACCID ON T_IFM_INNERACCOUNTINIT ( FINNERACCOUNTID ,FCURRENCY );


 EXEC P_ALTERPK 'PK_IFM_INNERACCT_ACC', 'T_IFM_INNERACCT_ACC', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_IFM_PAYACCEPTANCE', 'T_IFM_PAYACCEPTANCE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_PAYACC_FSCORGID') CREATE INDEX IDX_IFM_PAYACC_FSCORGID ON T_IFM_PAYACCEPTANCE ( FSCORGID );


 EXEC P_ALTERPK 'PK_IFM_PAYACCEPTANCE_E', 'T_IFM_PAYACCEPTANCE_E', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_PAYACC_FBANKPAYINGID') CREATE INDEX IDX_IFM_PAYACC_FBANKPAYINGID ON T_IFM_PAYACCEPTANCE_E ( FBANKPAYINGID );


 EXEC P_ALTERPK 'PK_IFM_PAYACCEPTANCEENTRY', 'T_IFM_PAYACCEPTANCEENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_IFM_SETTLECENTERINIT', 'T_IFM_SETTLECENTERINIT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_SCINIT_FSCORGID') CREATE INDEX IDX_IFM_SCINIT_FSCORGID ON T_IFM_SETTLECENTERINIT ( FSCORGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_SCINIT_FSCID') CREATE UNIQUE INDEX IDX_IFM_SCINIT_FSCID ON T_IFM_SETTLECENTERINIT ( FSCID );


 EXEC P_ALTERPK 'PK_IFM_TRANSHANDLE', 'T_IFM_TRANSHANDLE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_TRANSHANDLE_FSCORGID') CREATE INDEX IDX_IFM_TRANSHANDLE_FSCORGID ON T_IFM_TRANSHANDLE ( FSCORGID );


 EXEC P_ALTERPK 'PK_IFM_TRANSHANDLE_E', 'T_IFM_TRANSHANDLE_E', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_TRANSE_FBANKPAYID') CREATE INDEX IDX_IFM_TRANSE_FBANKPAYID ON T_IFM_TRANSHANDLE_E ( FBANKPAYINGID );


 EXEC P_ALTERPK 'PK_IFM_TRANSHANDLEENTRY', 'T_IFM_TRANSHANDLEENTRY', 'FENTRYID', '1';

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



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