/**Begin D:\PDM_UPGRADE\PDM1\FA_constraint.sql **/
 EXEC P_ALTERPK 'PK_FA_PC_LOCK_CONFIGN', 'T_FA_PC_LOCK_CONFIG_N', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_PC_LOCK_CONFIG_PURPOSEN') CREATE INDEX IDX_FA_PC_LOCK_CONFIG_PURPOSEN ON T_FA_PC_LOCK_CONFIG_N ( FLOCKEDENTITYCODE ,FUSEPURPOSE );


 EXEC P_ALTERPK 'PK_FA_HOLD_PCLOCK_BILLN', 'T_FA_HOLD_PCLOCK_BILL_N', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_HOLD_PCLOCK_UNIQUEN') CREATE INDEX IDX_FA_HOLD_PCLOCK_UNIQUEN ON T_FA_HOLD_PCLOCK_BILL_N ( FID ,FPARENTBILLENTITYCODE );


 EXEC P_ALTERPK 'PK_T_FA_BASE_STATUS_CTRN', 'T_FA_BASE_STATUS_CTR_N', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_BASE_STATUS_CTRN') CREATE INDEX IDX_FA_BASE_STATUS_CTRN ON T_FA_BASE_STATUS_CTR_N ( FENTRYID );


 EXEC P_ALTERPK 'PK_FA_HOLD_CCLOCK_BILLN', 'T_FA_HOLD_CCLOCK_BILL_N', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_HOLD_CCLOCK_UNIQUEN') CREATE UNIQUE INDEX IDX_FA_HOLD_CCLOCK_UNIQUEN ON T_FA_HOLD_CCLOCK_BILL_N ( FID ,FCHILDBILLENTITYCODE );


 EXEC P_ALTERPK 'PK_FA_PC_LOCKN', 'T_FA_PC_LOCK_N', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_PC_LOCK_FLOCKEDDATANUMN') CREATE INDEX IDX_FA_PC_LOCK_FLOCKEDDATANUMN ON T_FA_PC_LOCK_N ( FLOCKEDDATANUM ,FLOCKEDENTITYNAME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_PC_LOCK_UNIQUEN') CREATE UNIQUE INDEX IDX_FA_PC_LOCK_UNIQUEN ON T_FA_PC_LOCK_N ( FLOCKEDDATAMASTERID ,FLOCKEDENTITYNAME ,FUSEPURPOSE );


 EXEC P_ALTERPK 'PK_FA_PC_LOCK_DETAILN', 'T_FA_PC_LOCK_DETAIL_N', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_PC_LOCK_DETAIL_UNQN') CREATE INDEX IDX_FA_PC_LOCK_DETAIL_UNQN ON T_FA_PC_LOCK_DETAIL_N ( FID ,FDTHOLDLOCKENTITYNAME ,FDTHOLDLOCKDATAID );



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