/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FA_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_FA_INVENT_SPLITFIELD', 'T_FA_INVENT_SPLITFIELD', 'FDETAILID', '1';

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


 EXEC P_ALTERPK 'PK_T_FA_CARD_DYNAMIC', 'T_FA_CARD_DYNAMIC', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_DYNCARD_P') CREATE INDEX IDX_FA_DYNCARD_P ON T_FA_CARD_DYNAMIC ( FASSETBOOKID ,FPERIODID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_DYNCARD_C') CREATE INDEX IDX_FA_DYNCARD_C ON T_FA_CARD_DYNAMIC ( FREALCARDID ,FASSETBOOKID ,FDEPREUSEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_DYNCARD_B') CREATE INDEX IDX_FA_DYNCARD_B ON T_FA_CARD_DYNAMIC ( FENTITYNAME ,FCHANGEBILLID );


 EXEC P_ALTERPK 'PK_T_FA_INVENT_TASKRULE', 'T_FA_INVENT_TASKRULE', 'FDETAILID', '1';

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



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FA_constraint.sql **/
