• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/location/migration/migrate.php
  • Класс: BitrixSaleLocationMigrationCUpdaterLocationPro
  • Вызов: CUpdaterLocationPro::updateDBSchemaRestoreLegacyIndexes
static function updateDBSchemaRestoreLegacyIndexes()
{
	$dbConnection = BitrixMainHttpApplication::getConnection();

	$agentName = 'BitrixSaleLocationMigrationCUpdaterLocationPro::updateDBSchemaRestoreLegacyIndexes();';

	if(!Helper::checkIndexNameExists('IX_B_SALE_LOC_EXT_LID_SID', 'b_sale_loc_ext'))
	{
		$dbConnection->query('create index IX_B_SALE_LOC_EXT_LID_SID on b_sale_loc_ext (LOCATION_ID, SERVICE_ID)');
		return $agentName;
	}

	if(!Helper::checkIndexNameExists('IXS_LOCATION_COUNTRY_ID', 'b_sale_location'))
	{
		$dbConnection->query('create index IXS_LOCATION_COUNTRY_ID on b_sale_location (COUNTRY_ID)');
		return $agentName;
	}

	if(!Helper::checkIndexNameExists('IXS_LOCATION_REGION_ID', 'b_sale_location'))
	{
		$dbConnection->query('create index IXS_LOCATION_REGION_ID on b_sale_location (REGION_ID)');
		return $agentName;
	}

	if(!Helper::checkIndexNameExists('IXS_LOCATION_CITY_ID', 'b_sale_location'))
	{
		$dbConnection->query('create index IXS_LOCATION_CITY_ID on b_sale_location (CITY_ID)');
	}

	return false;
}