diff --git a/core/lib/Drupal/Core/Extension/ModuleHandler.php b/core/lib/Drupal/Core/Extension/ModuleHandler.php index 2ab3174..248c4c9 100644 --- a/core/lib/Drupal/Core/Extension/ModuleHandler.php +++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php @@ -808,7 +808,9 @@ public function install(array $module_list, $enable_dependencies = TRUE) { $storage = $entity_manager->getStorage($entity_type->id()); if ($storage instanceof ContentEntitySchemaHandlerInterface) { foreach ($storage->getSchema() as $table_name => $table_schema) { - $schema->createTable($table_name, $table_schema); + if (!$schema->tableExists($table_name)) { + $schema->createTable($table_name, $table_schema); + } } } } @@ -911,7 +913,9 @@ public function uninstall(array $module_list, $uninstall_dependents = TRUE) { $storage = $entity_manager->getStorage($entity_type->id()); if ($storage instanceof ContentEntitySchemaHandlerInterface) { foreach ($storage->getSchema() as $table_name => $table_schema) { - $schema->dropTable($table_name); + if ($schema->tableExists($table_name)) { + $schema->dropTable($table_name); + } } } }