/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FA_constraint.sql **/
/*表T_FA_DATA_DETAIL的主键列fentryid不允许修改，如果该表还未发布，请联系管理员变更基准模型重新生成表结构。*/


 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_ASSETSPLITENTRY_D' AND KSQL_INDNAME = 'IDX_FA_ASSETSPLIT_D_REAL') CREATE INDEX IDX_FA_ASSETSPLIT_D_REAL ON T_FA_ASSETSPLITENTRY_D ( FREALCARDID );

 EXEC P_ALTERPK 'PK_T_FA_UPGRADED_DATA', 'T_FA_UPGRADED_DATA', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_UPGRADED_DATA' AND KSQL_INDNAME = 'IDX_FA_UPGRADE_DATA') CREATE UNIQUE INDEX IDX_FA_UPGRADE_DATA ON T_FA_UPGRADED_DATA ( FPURPOSE ,FUPGRADEDENTIEYNAME ,FUPGRADEDID );

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