You are here

function drush_schema_fix in Schema 8

Implements drush_COMMANDFILE_COMMANDNAME().

File

./schema.drush.inc, line 162
Schema drush commands.

Code

function drush_schema_fix() {
  $comparison = \Drupal\schema\Comparison\SchemaComparator::compareDefault();
  $migrator = new \Drupal\schema\Migration\SchemaMigrator($comparison, schema_dbobject());
  $migrator
    ->options()
    ->setFixTableComments(TRUE)
    ->setUpdateColumnProperties(TRUE)
    ->setRemoveExtraColumns(TRUE)
    ->setRecreatePrimaryKey(TRUE)
    ->setRecreateIndexes(TRUE)
    ->setRecreateExtraIndexes(FALSE);
  $migrator
    ->execute();
}