public function SchemaMigrator::execute in Schema 8
File
- src/
Migration/ SchemaMigrator.php, line 52 - Contains Drupal\schema\Migration\SchemaMigrator.
Class
- SchemaMigrator
- Modifies the database schema to match the declared schema.
Namespace
Drupal\schema\MigrationCode
public function execute() {
$tables = $this
->getTargetTables();
if ($this
->options()->useDifferentTables) {
$tables += $this->comparison
->getDifferentTables();
}
if ($this
->options()->useSameTables) {
$tables += $this->comparison
->getSameTables();
}
/** @var TableComparison $table */
foreach ($tables as $table) {
if ($this
->options()->fixTableComments) {
$this
->fixTableComment($table);
}
if ($this
->options()->addMissingColumns) {
throw new \Exception("Adding missing columns not implemented yet.");
}
if ($this
->options()->updateColumnProperties) {
$this
->updateColumnProperties($table);
}
if ($this
->options()->removeExtraColumns) {
$this
->removeExtraColumns($table);
}
if ($this
->options()->recreatePrimaryKey) {
$this
->recreatePrimaryKey($table);
}
if ($this
->options()->recreateIndexes) {
$this
->recreateIndexes($table);
}
}
}