• Модуль: perfmon
  • Путь к файлу: ~/bitrix/modules/perfmon/lib/sql/schema.php
  • Класс: BitrixPerfmonSqlSchema
  • Вызов: Schema::executeAlter
protected function executeAlter(Tokenizer $tokenizer)
{
	$tokenizer->skipWhiteSpace();
	if ($tokenizer->testUpperText('TABLE'))
	{
		$tokenizer->skipWhiteSpace();
		$tableName = $tokenizer->getCurrentToken()->text;
		/** @var Table $table */
		$table = $this->tables->search($tableName);
		if (!$table)
		{
			throw new NotSupportedException("Table [$tableName] not found. line: ".$tokenizer->getCurrentToken()->line);
		}
		$tokenizer->nextToken();
		$tokenizer->skipWhiteSpace();
		if ($tokenizer->testUpperText('ADD'))
		{
			$tokenizer->skipWhiteSpace();
			if ($tokenizer->testUpperText('CONSTRAINT'))
			{
				$tokenizer->skipWhiteSpace();
				$table->createConstraint($tokenizer);
			}
		}
		elseif ($tokenizer->testUpperText('MODIFY'))
		{
			$tokenizer->skipWhiteSpace();
			$table->modifyColumn($tokenizer);
		}
		elseif ($tokenizer->testUpperText('NOCHECK') || $tokenizer->testUpperText('CHECK'))
		{
			//(NOCHECK|CHECK) CONSTRAINT ALL
		}
		elseif ($tokenizer->testUpperText('DISABLE') || $tokenizer->testUpperText('ENABLE'))
		{
			//(DISABLE|ENABLE) TRIGGER ALL
		}
		else
		{
			throw new NotSupportedException("'ADD' expected. line:".$tokenizer->getCurrentToken()->line);
		}
	}
	else
	{
		throw new NotSupportedException("'TABLE' expected. line:".$tokenizer->getCurrentToken()->line);
	}
}