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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CHANGEAPPLY_BILLNO') CREATE INDEX IDX_CHANGEAPPLY_BILLNO ON T_FA_CHANGE_APPLY ( FBILLNO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CHANGEAPPLY_FFF') CREATE INDEX IDX_CHANGEAPPLY_FFF ON T_FA_CHANGE_APPLY ( FASSETORGID ,FAPPLYDATE ,FBILLSTATUS );


 EXEC P_ALTERPK 'PK_T_FA_CHANGE_APPLY_ENTRY', 'T_FA_CHANGE_APPLY_ENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_FA_CHANGE_APPLY_ENTRY_L', 'T_FA_CHANGE_APPLY_ENTRY_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_CHANGEAPPLYENTRY') CREATE INDEX IDX_FA_CHANGEAPPLYENTRY ON T_FA_CHANGE_APPLY_ENTRY_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_FA_CHANGE_APPLY_LK', 'T_FA_CHANGE_APPLY_LK', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_FA_CHANGE_APPLY_TC', 'T_FA_CHANGE_APPLY_TC', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_CHANGEAPPLY_TC_FTBILLID') CREATE INDEX IDX_FA_CHANGEAPPLY_TC_FTBILLID ON T_FA_CHANGE_APPLY_TC ( FTBILLID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_CHANGEAPPLY_TC_FSBILLID') CREATE INDEX IDX_FA_CHANGEAPPLY_TC_FSBILLID ON T_FA_CHANGE_APPLY_TC ( FSBILLID );


 EXEC P_ALTERPK 'PK_T_FA_CHANGE_APPLY_WB', 'T_FA_CHANGE_APPLY_WB', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_FA_CHANGEAPPLY_CHGITEMS', 'T_FA_CHANGEAPPLY_CHGITEMS', 'FPKID', '1';

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



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