/** * Compile a change column command into a series of SQL statements. * * @param \Illuminate\Database\Schema\Blueprint $blueprint * @param \Illuminate\Support\Fluent $command * @param \Illuminate\Database\Connection $connection * @return array */ public function compileChange(Blueprint $blueprint, Fluent $command, Connection $connection) { if (!$connection->isDoctrineAvailable()) { throw new RuntimeException(sprintf('Changing columns for table "%s" requires Doctrine DBAL; install "doctrine/dbal".', $blueprint->getTable())); } $schema = $connection->getDoctrineSchemaManager(); $tableDiff = $this->getChangedDiff($blueprint, $schema); if ($tableDiff !== false) { return (array) $schema->getDatabasePlatform()->getAlterTableSQL($tableDiff); } return []; }