/**Begin D:\scm_code\dev_scm\dbschema\imc\1.5\main\rim\pdm\20210820\RIM_constraint.sql **/
EXEC p_DropIdx 'IDX_RIM_INV_COLLECT_USER', 'T_RIM_INV_COLLECT_USER';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_INV_COLLECT_USER') CREATE  CLUSTERED INDEX IDX_RIM_INV_COLLECT_USER ON T_RIM_INV_COLLECT_USER ( FCOLLECT_USER ,FRIM_USER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_ATTACH_USER') CREATE INDEX IDX_RIM_ATTACH_USER ON T_RIM_ATTACH ( FUSER ,FRIM_USER );

 EXEC P_ALTERPK 'PK_RIM_APP_AUTHORIZATION', 'T_RIM_APP_AUTHORIZATION', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_APP_AUTHORIZATION') CREATE  CLUSTERED INDEX IDX_RIM_APP_AUTHORIZATION ON T_RIM_APP_AUTHORIZATION ( FUSERID ,FRIM_USER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_APP_AUTHORIZATION2') CREATE INDEX IDX_RIM_APP_AUTHORIZATION2 ON T_RIM_APP_AUTHORIZATION ( FPHONE_NO );


 EXEC P_ALTERPK 'PK_RIM_USER', 'T_RIM_USER', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_RIM_USER') CREATE  CLUSTERED INDEX IDX_RIM_USER ON T_RIM_USER ( FRESOURCE ,FEXTERNAL_USER );



/**End D:\scm_code\dev_scm\dbschema\imc\1.5\main\rim\pdm\20210820\RIM_constraint.sql **/
