/**Begin D:\scm_code\PDM_UPGRADE_1.3\PDM_UPGRADE_1.3\PDM_UPGRADE\pdm2\RIM_constraint.sql **/
 

 EXEC P_ALTERPK 'PK_RIM_INVOICE_SERIAL', 'T_RIM_INVOICE_SERIAL', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INVOICE_SERIAL') CREATE  CLUSTERED INDEX IDX_RIM_INVOICE_SERIAL ON T_RIM_INVOICE_SERIAL ( FAWS_SERIAL_NO );


 EXEC P_ALTERPK 'PK_RIM_RECEIVE_MESSAGE', 'T_RIM_RECEIVE_MESSAGE', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_RECEIVE_MESSAGE') CREATE  CLUSTERED INDEX IDX_RIM_RECEIVE_MESSAGE ON T_RIM_RECEIVE_MESSAGE ( FBIZID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_RECEIVE_MESSAGE_TIME') CREATE INDEX IDX_RIM_RECEIVE_MESSAGE_TIME ON T_RIM_RECEIVE_MESSAGE ( FCREATETIME );


 EXEC p_AlterPK 'PK_T_RIM_INV_FINANCIAL_ITEMA', 'T_RIM_INV_FINANCIAL_ITEMA', 'FENTRYID', '0';
EXEC p_DropIdx 'IDX_RIM_INV_FINANCIAL_ITEMA_FK', 'T_RIM_INV_FINANCIAL_ITEMA';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_FINANCIAL_ITEMA_FK') CREATE  CLUSTERED INDEX IDX_RIM_INV_FINANCIAL_ITEMA_FK ON T_RIM_INV_FINANCIAL_ITEMA ( FID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INVOICE_UNCHECK_NO') CREATE INDEX IDX_RIM_INVOICE_UNCHECK_NO ON T_RIM_INVOICE_UNCHECK ( FSERIAL_NO );


/**End D:\scm_code\PDM_UPGRADE_1.3\PDM_UPGRADE_1.3\PDM_UPGRADE\pdm2\RIM_constraint.sql **/
