/**Begin D:\PDM_UPGRADE\PDM1\FCS_constraint.sql **/
  EXEC P_ALTERPK 'PK_FCS_RISKSCENE_CULLING', 'T_FCS_RISKSCENE_CULLING', 'FID', '1';

  IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_RISKSCENE_CULLING') CREATE INDEX IDX_FCS_RISKSCENE_CULLING ON T_FCS_RISKSCENE_CULLING ( FBILLENTITY );


  EXEC P_ALTERPK 'PK_FCS_RISKSCENE_CULLING_L', 'T_FCS_RISKSCENE_CULLING_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_FCS_ERRORFIELD_SCENE', 'T_FCS_ERRORFIELD_SCENE', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_FCS_RISKFEATURE_CULLING', 'T_FCS_RISKFEATURE_CULLING', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_RISKFEATURE_CULLING') CREATE INDEX IDX_FCS_RISKFEATURE_CULLING ON T_FCS_RISKFEATURE_CULLING ( FENABLE ,FBILLENTITY );


 EXEC P_ALTERPK 'PK_FCS_RISKFEATURE_CULLING_L', 'T_FCS_RISKFEATURE_CULLING_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_FCS_RISKFEATURE_ENTRY', 'T_FCS_RISKFEATURE_ENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_RISKFEATURE_ENTRY') CREATE INDEX IDX_FCS_RISKFEATURE_ENTRY ON T_FCS_RISKFEATURE_ENTRY ( FID );
 EXEC P_ALTERPK 'PK_FCS_RISK_LOG', 'T_FCS_RISK_LOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_RISKLOG_1') CREATE INDEX IDX_FCS_RISKLOG_1 ON T_FCS_RISK_LOG ( FCREATEDATE  DESC );


 EXEC P_ALTERPK 'PK_FCS_RISKBILL_LOG', 'T_FCS_RISKBILL_LOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_RISKBILLLOG_1') CREATE INDEX IDX_FCS_RISKBILLLOG_1 ON T_FCS_RISKBILL_LOG ( FRISKLOGID ,FBILLID );


 EXEC P_ALTERPK 'PK_FCS_RISKSCREEN_LOG', 'T_FCS_RISKSCREEN_LOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FCS_RISKSCREENLOG_1') CREATE INDEX IDX_FCS_RISKSCREENLOG_1 ON T_FCS_RISKSCREEN_LOG ( FRISKLOGID );



/**End D:\PDM_UPGRADE\PDM1\FCS_constraint.sql **/
