/**Begin D:\PDM_UPGRADE\PDM1\BOS_constraint.sql **/
 EXEC P_ALTERPK 'PK_BD_ACCOUNTBANKS_ST', 'T_BD_ACCOUNTBANKS_ST', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_ACCOUNTBANKS_ST_FK') CREATE INDEX IDX_BD_ACCOUNTBANKS_ST_FK ON T_BD_ACCOUNTBANKS_ST ( FID ,FBASEDATAID );


 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_ORG_ORG_PARENTID') CREATE INDEX IDX_T_ORG_ORG_PARENTID ON T_ORG_ORG ( FORGPATTERNID );

EXEC p_DropIdx 'IDX_T_BAS_ExternalSys_L_FID', 'T_BAS_EXTERNALSYS_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BAS_EXTERNALSYS_L_FID') CREATE INDEX IDX_T_BAS_EXTERNALSYS_L_FID ON T_BAS_EXTERNALSYS_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_T_BAS_DataType_L_FID', 'T_BAS_DATATYPE_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BAS_DATATYPE_L_FID') CREATE INDEX IDX_T_BAS_DATATYPE_L_FID ON T_BAS_DATATYPE_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_T_BAS_DataMapping_L_FID', 'T_BAS_DATAMAPPING_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BAS_DATAMAPPING_L_FID') CREATE INDEX IDX_T_BAS_DATAMAPPING_L_FID ON T_BAS_DATAMAPPING_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BAS_PositionMapping_L_FID', 'T_BAS_POSITIONMAPPING_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BAS_POSITIONMAPPING_L_FID') CREATE INDEX IDX_BAS_POSITIONMAPPING_L_FID ON T_BAS_POSITIONMAPPING_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_T_BAS_UITheme_L_FID', 'T_BAS_UITHEME_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BAS_UITHEME_L_FID') CREATE INDEX IDX_T_BAS_UITHEME_L_FID ON T_BAS_UITHEME_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_T_BAS_SubNumSrc_L_FID', 'T_BAS_SUBNUMSRC_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BAS_SUBNUMSRC_L_FID') CREATE INDEX IDX_T_BAS_SUBNUMSRC_L_FID ON T_BAS_SUBNUMSRC_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_T_BAS_CardCfg_FID', 'T_BAS_CARDCFG_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BAS_CARDCFG_FID') CREATE INDEX IDX_T_BAS_CARDCFG_FID ON T_BAS_CARDCFG_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_BAS_SubscriptionNum_L_FID', 'T_BAS_SUBSCRIPTIONNUM_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BAS_SUBSCRIPTIONNUM_L_FID') CREATE INDEX IDX_BAS_SUBSCRIPTIONNUM_L_FID ON T_BAS_SUBSCRIPTIONNUM_L ( FENTRYID ,FLOCALEID );

EXEC p_DropIdx 'IX_PERM_00000013', 'T_PERM_HIERACHYRULE_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IX_PERM_00000013') CREATE INDEX IX_PERM_00000013 ON T_PERM_HIERACHYRULE_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IX_PERM_00000014', 'T_PERM_GROUPSCHEME_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IX_PERM_00000014') CREATE INDEX IX_PERM_00000014 ON T_PERM_GROUPSCHEME_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IX_PERM_00000015', 'T_PERM_ROLE_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IX_PERM_00000015') CREATE INDEX IX_PERM_00000015 ON T_PERM_ROLE_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IX_PERM_00000011', 'T_PERM_OPERATIONRULE_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IX_PERM_00000011') CREATE INDEX IX_PERM_00000011 ON T_PERM_OPERATIONRULE_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IX_PERM_00000012', 'T_PERM_PERMITEM_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IX_PERM_00000012') CREATE INDEX IX_PERM_00000012 ON T_PERM_PERMITEM_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_YZJ_UserPos_L_FEntryID', 'T_YZJ_USERPOSITION_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_YZJ_USERPOS_L_FENTRYID') CREATE INDEX IDX_YZJ_USERPOS_L_FENTRYID ON T_YZJ_USERPOSITION_L ( FENTRYID ,FLOCALEID );

EXEC p_DropIdx 'IDX_T_SEC_UserGroup_L_FID', 'T_SEC_USERGROUP_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_SEC_USERGROUP_L_FID') CREATE INDEX IDX_T_SEC_USERGROUP_L_FID ON T_SEC_USERGROUP_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_T_SEC_UserChange_L_FID', 'T_SEC_USERCHANGE_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_SEC_USERCHANGE_L_FID') CREATE INDEX IDX_T_SEC_USERCHANGE_L_FID ON T_SEC_USERCHANGE_L ( FID ,FLOCALEID );

EXEC p_DropIdx 'IDX_T_SEC_UserType_L_FID', 'T_SEC_USERTYPE_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_SEC_USERTYPE_L_FID') CREATE INDEX IDX_T_SEC_USERTYPE_L_FID ON T_SEC_USERTYPE_L ( FID ,FLOCALEID );


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