diff --git a/core/lib/Drupal/Core/Database/Connection.php b/core/lib/Drupal/Core/Database/Connection.php index 5efa47a22a..bdb02c3f27 100644 --- a/core/lib/Drupal/Core/Database/Connection.php +++ b/core/lib/Drupal/Core/Database/Connection.php @@ -154,6 +154,11 @@ abstract class Connection { */ protected $escapedAliases = []; + /** + * The sequences table name. + */ + const SEQUENCES_TABLE_NAME = 'sequences'; + /** * Constructs a Connection object. * @@ -1595,4 +1600,48 @@ public static function createUrlFromConnectionOptions(array $connection_options) return $db_url; } + /** + * Returns the sequences schema. + * + * @return array + * Schema definition array. + */ + public function getSequencesSchema() { + return [ + 'description' => 'Stores IDs.', + 'fields' => [ + 'value' => [ + 'description' => 'The value of the sequence.', + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ], + ], + 'primary key' => ['value'], + ]; + } + + /** + * Check if the table exists and create it if not. + * + * @return bool + * TRUE when table exists, FALSE otherwise. + */ + protected function ensureSequencesTableExists() { + try { + $schema = $this->schema(); + if (!$schema->tableExists(static::SEQUENCES_TABLE_NAME)) { + $schema->createTable(static::SEQUENCES_TABLE_NAME, $this->getSequencesSchema()); + return TRUE; + } + } + // If another process has already created the table, attempting to + // recreate it will throw an exception. In this case just catch the + // exception and do nothing. + catch (SchemaObjectExistsException $e) { + return TRUE; + } + return FALSE; + } + } diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php b/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php index 04abdd4375..1a5f71cfc8 100644 --- a/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php +++ b/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php @@ -579,7 +579,18 @@ public function mapConditionOperator($operator) { } public function nextId($existing_id = 0) { - $new_id = $this->query('INSERT INTO {sequences} () VALUES ()', [], ['return' => Database::RETURN_INSERT_ID]); + $try_again = FALSE; + try { + $new_id = $this->query('INSERT INTO {sequences} () VALUES ()', [], ['return' => Database::RETURN_INSERT_ID]); + } + catch (\Exception $e) { + if (!$try_again = $this->ensureSequencesTableExists($e)) { + throw $e; + } + } + if ($try_again) { + $new_id = $this->query('INSERT INTO {sequences} () VALUES ()', [], ['return' => Database::RETURN_INSERT_ID]); + } // This should only happen after an import or similar event. if ($existing_id >= $new_id) { // If we INSERT a value manually into the sequences table, on the next diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php index f8a8c3b3eb..101df3a8e1 100644 --- a/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php +++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php @@ -351,7 +351,15 @@ public function nextId($existing = 0) { // When PostgreSQL gets a value too small then it will lock the table, // retry the INSERT and if it's still too small then alter the sequence. - $id = $this->query("SELECT nextval('" . $sequence_name . "')")->fetchField(); + try { + $id = $this->query("SELECT nextval('" . $sequence_name . "')")->fetchField(); + } + catch (\Exception $e) { + if (!$this->ensureSequencesTableExists()) { + throw $e; + } + $id = 0; + } if ($id > $existing) { return $id; } diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php index fe007cfe05..3fbd6afcd7 100644 --- a/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php +++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php @@ -412,10 +412,18 @@ public function nextId($existing_id = 0) { // wait until this transaction commits. Also, the return value needs to be // set to RETURN_AFFECTED as if it were a real update() query otherwise it // is not possible to get the row count properly. - $affected = $this->query('UPDATE {sequences} SET value = GREATEST(value, :existing_id) + 1', [ - ':existing_id' => $existing_id, - ], ['return' => Database::RETURN_AFFECTED]); - if (!$affected) { + try { + $affected = $this->query('UPDATE {sequences} SET value = GREATEST(value, :existing_id) + 1', [ + ':existing_id' => $existing_id, + ], ['return' => Database::RETURN_AFFECTED]); + } + catch (\Exception $e) { + if (!$this->ensureSequencesTableExists()) { + throw $e; + } + $affected = TRUE; + } + if (!empty($affected)) { $this->query('INSERT INTO {sequences} (value) VALUES (:existing_id + 1)', [ ':existing_id' => $existing_id, ]); diff --git a/core/modules/block_content/tests/src/Kernel/BlockContentAccessHandlerTest.php b/core/modules/block_content/tests/src/Kernel/BlockContentAccessHandlerTest.php index 0c4c0a4493..3b1a133bfe 100644 --- a/core/modules/block_content/tests/src/Kernel/BlockContentAccessHandlerTest.php +++ b/core/modules/block_content/tests/src/Kernel/BlockContentAccessHandlerTest.php @@ -56,7 +56,6 @@ class BlockContentAccessHandlerTest extends KernelTestBase { */ protected function setUp() { parent::setUp(); - $this->installSchema('system', ['sequences']); $this->installSchema('user', ['users_data']); $this->installEntitySchema('user'); $this->installEntitySchema('block_content'); diff --git a/core/modules/block_content/tests/src/Kernel/BlockContentEntityReferenceSelectionTest.php b/core/modules/block_content/tests/src/Kernel/BlockContentEntityReferenceSelectionTest.php index 19b8e4aeac..41e8f94fa0 100644 --- a/core/modules/block_content/tests/src/Kernel/BlockContentEntityReferenceSelectionTest.php +++ b/core/modules/block_content/tests/src/Kernel/BlockContentEntityReferenceSelectionTest.php @@ -67,7 +67,6 @@ class BlockContentEntityReferenceSelectionTest extends KernelTestBase { */ public function setUp() { parent::setUp(); - $this->installSchema('system', ['sequences']); $this->installEntitySchema('user'); $this->installEntitySchema('block_content'); diff --git a/core/modules/comment/tests/src/Kernel/Migrate/MigrateCommentStubTest.php b/core/modules/comment/tests/src/Kernel/Migrate/MigrateCommentStubTest.php index fdb415e46e..0cca41b74f 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/MigrateCommentStubTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/MigrateCommentStubTest.php @@ -28,7 +28,6 @@ protected function setUp() { parent::setUp(); $this->installEntitySchema('comment'); $this->installEntitySchema('node'); - $this->installSchema('system', ['sequences']); // Make sure uid 0 is created (default uid for comments is 0). $storage = \Drupal::entityTypeManager()->getStorage('user'); diff --git a/core/modules/comment/tests/src/Kernel/Views/CommentFieldNameTest.php b/core/modules/comment/tests/src/Kernel/Views/CommentFieldNameTest.php index af2a451bc5..e90ccc47e0 100644 --- a/core/modules/comment/tests/src/Kernel/Views/CommentFieldNameTest.php +++ b/core/modules/comment/tests/src/Kernel/Views/CommentFieldNameTest.php @@ -57,7 +57,6 @@ public function testCommentFieldName() { $this->installEntitySchema('user'); $this->installEntitySchema('node'); $this->installEntitySchema('comment'); - $this->installSchema('system', ['sequences']); $this->installSchema('comment', ['comment_entity_statistics']); $this->installConfig(['filter']); diff --git a/core/modules/comment/tests/src/Kernel/Views/FilterAndArgumentUserUidTest.php b/core/modules/comment/tests/src/Kernel/Views/FilterAndArgumentUserUidTest.php index 7dfc6896ff..e82288b231 100644 --- a/core/modules/comment/tests/src/Kernel/Views/FilterAndArgumentUserUidTest.php +++ b/core/modules/comment/tests/src/Kernel/Views/FilterAndArgumentUserUidTest.php @@ -52,7 +52,6 @@ class FilterAndArgumentUserUidTest extends KernelTestBase { */ public function testHandlers() { $this->installEntitySchema('user'); - $this->installSchema('system', ['sequences']); $this->installEntitySchema('node'); $this->installEntitySchema('comment'); $this->installSchema('comment', ['comment_entity_statistics']); diff --git a/core/modules/content_moderation/tests/src/Kernel/EntityStateChangeValidationTest.php b/core/modules/content_moderation/tests/src/Kernel/EntityStateChangeValidationTest.php index 7b8d8dd265..ead8b24c18 100644 --- a/core/modules/content_moderation/tests/src/Kernel/EntityStateChangeValidationTest.php +++ b/core/modules/content_moderation/tests/src/Kernel/EntityStateChangeValidationTest.php @@ -49,7 +49,6 @@ protected function setUp() { $this->installEntitySchema('user'); $this->installEntitySchema('content_moderation_state'); $this->installConfig('content_moderation'); - $this->installSchema('system', ['sequences']); $this->adminUser = $this->createUser(array_keys($this->container->get('user.permissions')->getPermissions())); } diff --git a/core/modules/content_moderation/tests/src/Kernel/NodeAccessTest.php b/core/modules/content_moderation/tests/src/Kernel/NodeAccessTest.php index 3a2e0a9ed3..94062fc0c5 100644 --- a/core/modules/content_moderation/tests/src/Kernel/NodeAccessTest.php +++ b/core/modules/content_moderation/tests/src/Kernel/NodeAccessTest.php @@ -50,7 +50,6 @@ protected function setUp() { $this->installEntitySchema('user'); $this->installEntitySchema('workflow'); $this->installConfig(['content_moderation', 'filter']); - $this->installSchema('system', ['sequences']); $this->installSchema('node', ['node_access']); // Add a moderated node type. diff --git a/core/modules/datetime/tests/src/Kernel/DateTimeFormInjectionTest.php b/core/modules/datetime/tests/src/Kernel/DateTimeFormInjectionTest.php index 1b1cb339b2..d248ce9574 100644 --- a/core/modules/datetime/tests/src/Kernel/DateTimeFormInjectionTest.php +++ b/core/modules/datetime/tests/src/Kernel/DateTimeFormInjectionTest.php @@ -37,7 +37,7 @@ class DateTimeFormInjectionTest extends KernelTestBase implements FormInterface */ protected function setUp() { parent::setUp(); - $this->installSchema('system', ['key_value_expire', 'sequences']); + $this->installSchema('system', ['key_value_expire']); } /** diff --git a/core/modules/datetime_range/tests/src/Kernel/SeparatorTranslationTest.php b/core/modules/datetime_range/tests/src/Kernel/SeparatorTranslationTest.php index d92a313f39..81026160be 100644 --- a/core/modules/datetime_range/tests/src/Kernel/SeparatorTranslationTest.php +++ b/core/modules/datetime_range/tests/src/Kernel/SeparatorTranslationTest.php @@ -54,7 +54,7 @@ protected function setUp() { $this->installEntitySchema('entity_test'); $this->installEntitySchema('user'); $this->installConfig(['system']); - $this->installSchema('system', ['sequences', 'key_value']); + $this->installSchema('system', ['key_value']); // Add a datetime range field. $this->fieldStorage = FieldStorageConfig::create([ diff --git a/core/modules/dblog/tests/src/Kernel/DbLogFormInjectionTest.php b/core/modules/dblog/tests/src/Kernel/DbLogFormInjectionTest.php index 48ed39616e..904de8e650 100644 --- a/core/modules/dblog/tests/src/Kernel/DbLogFormInjectionTest.php +++ b/core/modules/dblog/tests/src/Kernel/DbLogFormInjectionTest.php @@ -78,7 +78,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { protected function setUp() { parent::setUp(); $this->installSchema('dblog', ['watchdog']); - $this->installSchema('system', ['key_value_expire', 'sequences']); + $this->installSchema('system', ['key_value_expire']); $this->installEntitySchema('user'); $this->logger = \Drupal::logger('test_logger'); $test_user = User::create([ diff --git a/core/modules/dblog/tests/src/Kernel/DbLogTest.php b/core/modules/dblog/tests/src/Kernel/DbLogTest.php index b211cc7414..71fba59520 100644 --- a/core/modules/dblog/tests/src/Kernel/DbLogTest.php +++ b/core/modules/dblog/tests/src/Kernel/DbLogTest.php @@ -28,7 +28,7 @@ protected function setUp() { parent::setUp(); $this->installSchema('dblog', ['watchdog']); - $this->installSchema('system', ['key_value_expire', 'sequences']); + $this->installSchema('system', ['key_value_expire']); $this->installConfig(['system']); } diff --git a/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php b/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php index fdc8940fd6..5c280ee9c6 100644 --- a/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php +++ b/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php @@ -47,7 +47,7 @@ protected function setUp() { $this->installEntitySchema('entity_test'); $this->installEntitySchema('user'); - $this->installSchema('system', ['sequences', 'key_value']); + $this->installSchema('system', ['key_value']); // Set default storage backend and configure the theme system. $this->installConfig(['field', 'system']); diff --git a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceLabelDescriptionTest.php b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceLabelDescriptionTest.php index fe99f5a261..2253cb179c 100644 --- a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceLabelDescriptionTest.php +++ b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceLabelDescriptionTest.php @@ -37,7 +37,6 @@ public function setUp() { $this->installEntitySchema('node'); $this->installConfig(['node']); $this->installSchema('node', ['node_access']); - $this->installSchema('system', ['sequences']); $this->executeMigration('language'); $this->executeMigration('d6_field_instance_label_description_translation'); } diff --git a/core/modules/file/tests/src/Kernel/AccessTest.php b/core/modules/file/tests/src/Kernel/AccessTest.php index d875c1f664..16f96a4965 100644 --- a/core/modules/file/tests/src/Kernel/AccessTest.php +++ b/core/modules/file/tests/src/Kernel/AccessTest.php @@ -50,7 +50,6 @@ protected function setUp() { $this->installEntitySchema('file'); $this->installEntitySchema('user'); $this->installSchema('file', ['file_usage']); - $this->installSchema('system', 'sequences'); $this->user1 = User::create([ 'name' => 'user1', diff --git a/core/modules/file/tests/src/Kernel/FileItemValidationTest.php b/core/modules/file/tests/src/Kernel/FileItemValidationTest.php index 6fbc82f39a..165b1cb74d 100644 --- a/core/modules/file/tests/src/Kernel/FileItemValidationTest.php +++ b/core/modules/file/tests/src/Kernel/FileItemValidationTest.php @@ -39,7 +39,6 @@ protected function setUp() { $this->installEntitySchema('user'); $this->installEntitySchema('file'); $this->installSchema('file', 'file_usage'); - $this->installSchema('system', 'sequences'); $this->user = User::create([ 'name' => 'username', diff --git a/core/modules/file/tests/src/Kernel/FileManagedAccessTest.php b/core/modules/file/tests/src/Kernel/FileManagedAccessTest.php index 87a11f789a..a15ab9847e 100644 --- a/core/modules/file/tests/src/Kernel/FileManagedAccessTest.php +++ b/core/modules/file/tests/src/Kernel/FileManagedAccessTest.php @@ -30,7 +30,6 @@ class FileManagedAccessTest extends KernelTestBase { * Tests if public file is always accessible. */ public function testFileAccess() { - $this->installSchema('system', ['sequences']); $this->installEntitySchema('user'); $this->installEntitySchema('file'); $this->installSchema('file', ['file_usage']); diff --git a/core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php b/core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php index 8fca62e965..5ef6368267 100644 --- a/core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php +++ b/core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php @@ -36,7 +36,6 @@ class TextFormatElementFormTest extends KernelTestBase implements FormInterface protected function setUp() { parent::setUp(); $this->installEntitySchema('user'); - $this->installSchema('system', ['sequences']); $this->installConfig(['filter', 'filter_test']); // Filter tips link to the full-page. \Drupal::service('router.builder')->rebuild(); diff --git a/core/modules/hal/tests/src/Kernel/EntityTranslationNormalizeTest.php b/core/modules/hal/tests/src/Kernel/EntityTranslationNormalizeTest.php index 2ebff20247..68c51920a2 100644 --- a/core/modules/hal/tests/src/Kernel/EntityTranslationNormalizeTest.php +++ b/core/modules/hal/tests/src/Kernel/EntityTranslationNormalizeTest.php @@ -26,7 +26,6 @@ class EntityTranslationNormalizeTest extends NormalizerTestBase { */ protected function setUp() { parent::setUp(); - $this->installSchema('system', ['sequences']); $this->installConfig(['node', 'content_translation']); } diff --git a/core/modules/history/tests/src/Kernel/HistoryLegacyTest.php b/core/modules/history/tests/src/Kernel/HistoryLegacyTest.php index 82d0b3345f..638c4fddc2 100644 --- a/core/modules/history/tests/src/Kernel/HistoryLegacyTest.php +++ b/core/modules/history/tests/src/Kernel/HistoryLegacyTest.php @@ -28,7 +28,6 @@ protected function setUp() { $this->installEntitySchema('node'); $this->installEntitySchema('user'); $this->installSchema('history', ['history']); - $this->installSchema('system', ['sequences']); } diff --git a/core/modules/jsonapi/tests/src/Kernel/Controller/EntityResourceTest.php b/core/modules/jsonapi/tests/src/Kernel/Controller/EntityResourceTest.php index d60d66dcf4..9f591712fc 100644 --- a/core/modules/jsonapi/tests/src/Kernel/Controller/EntityResourceTest.php +++ b/core/modules/jsonapi/tests/src/Kernel/Controller/EntityResourceTest.php @@ -98,7 +98,6 @@ protected function setUp() { $this->installEntitySchema('node'); $this->installEntitySchema('user'); // Add the additional table schemas. - $this->installSchema('system', ['sequences']); $this->installSchema('node', ['node_access']); $this->installSchema('user', ['users_data']); NodeType::create([ diff --git a/core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php b/core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php index 0d2f093f01..666d8ea2be 100644 --- a/core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php +++ b/core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php @@ -88,7 +88,6 @@ protected function setUp() { $this->installEntitySchema('taxonomy_term'); $this->installEntitySchema('file'); // Add the additional table schemas. - $this->installSchema('system', ['sequences']); $this->installSchema('node', ['node_access']); $this->installSchema('user', ['users_data']); $this->installSchema('file', ['file_usage']); diff --git a/core/modules/jsonapi/tests/src/Kernel/Normalizer/RelationshipNormalizerTest.php b/core/modules/jsonapi/tests/src/Kernel/Normalizer/RelationshipNormalizerTest.php index f770071770..56668d604f 100644 --- a/core/modules/jsonapi/tests/src/Kernel/Normalizer/RelationshipNormalizerTest.php +++ b/core/modules/jsonapi/tests/src/Kernel/Normalizer/RelationshipNormalizerTest.php @@ -79,7 +79,6 @@ protected function setUp() { $this->installEntitySchema('file'); // Add the additional table schemas. - $this->installSchema('system', ['sequences']); $this->installSchema('node', ['node_access']); $this->installSchema('file', ['file_usage']); NodeType::create([ diff --git a/core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php b/core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php index 2a644615a2..f75f89bb4a 100644 --- a/core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php +++ b/core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php @@ -265,7 +265,6 @@ protected function queryConditionData() { * Sets up the schemas. */ protected function setUpSchemas() { - $this->installSchema('system', ['sequences']); $this->installSchema('node', ['node_access']); $this->installSchema('user', ['users_data']); diff --git a/core/modules/jsonapi/tests/src/Kernel/ResourceType/RelatedResourceTypesTest.php b/core/modules/jsonapi/tests/src/Kernel/ResourceType/RelatedResourceTypesTest.php index 3ca39f855f..57a5392c88 100644 --- a/core/modules/jsonapi/tests/src/Kernel/ResourceType/RelatedResourceTypesTest.php +++ b/core/modules/jsonapi/tests/src/Kernel/ResourceType/RelatedResourceTypesTest.php @@ -57,7 +57,6 @@ protected function setUp() { $this->installEntitySchema('user'); // Add the additional table schemas. - $this->installSchema('system', ['sequences']); $this->installSchema('node', ['node_access']); $this->installSchema('user', ['users_data']); diff --git a/core/modules/jsonapi/tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php b/core/modules/jsonapi/tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php index b7ecced323..7e7c196c04 100644 --- a/core/modules/jsonapi/tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php +++ b/core/modules/jsonapi/tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php @@ -43,7 +43,6 @@ protected function setUp() { $this->installEntitySchema('node'); $this->installEntitySchema('user'); // Add the additional table schemas. - $this->installSchema('system', ['sequences']); $this->installSchema('node', ['node_access']); $this->installSchema('user', ['users_data']); NodeType::create([ diff --git a/core/modules/jsonapi/tests/src/Kernel/Revisions/VersionNegotiatorTest.php b/core/modules/jsonapi/tests/src/Kernel/Revisions/VersionNegotiatorTest.php index 774b51ec51..73c59d7b11 100644 --- a/core/modules/jsonapi/tests/src/Kernel/Revisions/VersionNegotiatorTest.php +++ b/core/modules/jsonapi/tests/src/Kernel/Revisions/VersionNegotiatorTest.php @@ -77,7 +77,6 @@ protected function setUp() { $this->installEntitySchema('node'); $this->installEntitySchema('user'); // Add the additional table schemas. - $this->installSchema('system', ['sequences']); $this->installSchema('node', ['node_access']); $this->installSchema('user', ['users_data']); $type = NodeType::create([ diff --git a/core/modules/jsonapi/tests/src/Kernel/Serializer/SerializerTest.php b/core/modules/jsonapi/tests/src/Kernel/Serializer/SerializerTest.php index e0cd524b97..08269592a9 100644 --- a/core/modules/jsonapi/tests/src/Kernel/Serializer/SerializerTest.php +++ b/core/modules/jsonapi/tests/src/Kernel/Serializer/SerializerTest.php @@ -65,7 +65,6 @@ protected function setUp() { $this->installEntitySchema('node'); $this->installEntitySchema('user'); // Add the additional table schemas. - $this->installSchema('system', ['sequences']); $this->installSchema('node', ['node_access']); $this->installSchema('user', ['users_data']); $this->user = User::create([ diff --git a/core/modules/media/tests/src/Kernel/MediaEmbedFilterTestBase.php b/core/modules/media/tests/src/Kernel/MediaEmbedFilterTestBase.php index 675223c3d2..fd6a5ce95f 100644 --- a/core/modules/media/tests/src/Kernel/MediaEmbedFilterTestBase.php +++ b/core/modules/media/tests/src/Kernel/MediaEmbedFilterTestBase.php @@ -71,7 +71,6 @@ protected function setUp() { parent::setUp(); $this->installSchema('file', ['file_usage']); - $this->installSchema('system', 'sequences'); $this->installEntitySchema('file'); $this->installEntitySchema('media'); $this->installEntitySchema('user'); diff --git a/core/modules/media/tests/src/Kernel/MediaKernelTestBase.php b/core/modules/media/tests/src/Kernel/MediaKernelTestBase.php index 1c6a879eea..ec6eb5dacb 100644 --- a/core/modules/media/tests/src/Kernel/MediaKernelTestBase.php +++ b/core/modules/media/tests/src/Kernel/MediaKernelTestBase.php @@ -62,7 +62,6 @@ protected function setUp() { $this->installEntitySchema('user'); $this->installEntitySchema('file'); $this->installSchema('file', 'file_usage'); - $this->installSchema('system', 'sequences'); $this->installEntitySchema('media'); $this->installConfig(['field', 'system', 'image', 'file', 'media']); diff --git a/core/modules/media_library/tests/src/Kernel/MediaLibraryAccessTest.php b/core/modules/media_library/tests/src/Kernel/MediaLibraryAccessTest.php index 389561d4e2..4a995ef630 100644 --- a/core/modules/media_library/tests/src/Kernel/MediaLibraryAccessTest.php +++ b/core/modules/media_library/tests/src/Kernel/MediaLibraryAccessTest.php @@ -49,7 +49,7 @@ protected function setUp() { $this->installEntitySchema('user'); $this->installEntitySchema('file'); $this->installSchema('file', 'file_usage'); - $this->installSchema('system', ['sequences', 'key_value_expire']); + $this->installSchema('system', ['key_value_expire']); $this->installEntitySchema('entity_test'); $this->installEntitySchema('filter_format'); $this->installEntitySchema('media'); diff --git a/core/modules/media_library/tests/src/Kernel/MediaLibraryAddFormTest.php b/core/modules/media_library/tests/src/Kernel/MediaLibraryAddFormTest.php index 51b70c9780..d3f3507922 100644 --- a/core/modules/media_library/tests/src/Kernel/MediaLibraryAddFormTest.php +++ b/core/modules/media_library/tests/src/Kernel/MediaLibraryAddFormTest.php @@ -43,7 +43,7 @@ protected function setUp() { $this->installEntitySchema('user'); $this->installEntitySchema('file'); $this->installSchema('file', 'file_usage'); - $this->installSchema('system', ['sequences', 'key_value_expire']); + $this->installSchema('system', ['key_value_expire']); $this->installEntitySchema('media'); $this->installConfig([ 'field', diff --git a/core/modules/media_library/tests/src/Kernel/MediaLibraryStateTest.php b/core/modules/media_library/tests/src/Kernel/MediaLibraryStateTest.php index ab0bdcce20..6aeab059b9 100644 --- a/core/modules/media_library/tests/src/Kernel/MediaLibraryStateTest.php +++ b/core/modules/media_library/tests/src/Kernel/MediaLibraryStateTest.php @@ -42,7 +42,6 @@ protected function setUp() { $this->installEntitySchema('user'); $this->installEntitySchema('file'); $this->installSchema('file', 'file_usage'); - $this->installSchema('system', 'sequences'); $this->installEntitySchema('media'); $this->installConfig([ 'field', diff --git a/core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php b/core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php index c5bf428eb7..3006ba5be0 100644 --- a/core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php +++ b/core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php @@ -38,7 +38,6 @@ protected function setUp() { $this->menuLinkManager = \Drupal::service('plugin.manager.menu.link'); - $this->installSchema('system', ['sequences']); $this->installSchema('user', ['users_data']); $this->installEntitySchema('menu_link_content'); $this->installEntitySchema('user'); diff --git a/core/modules/migrate/tests/src/Kernel/MigrateExternalTranslatedTest.php b/core/modules/migrate/tests/src/Kernel/MigrateExternalTranslatedTest.php index ea45a78fca..d0f1f218c8 100644 --- a/core/modules/migrate/tests/src/Kernel/MigrateExternalTranslatedTest.php +++ b/core/modules/migrate/tests/src/Kernel/MigrateExternalTranslatedTest.php @@ -26,7 +26,6 @@ class MigrateExternalTranslatedTest extends MigrateTestBase { */ public function setUp() { parent::setUp(); - $this->installSchema('system', ['sequences']); $this->installSchema('node', ['node_access']); $this->installEntitySchema('user'); $this->installEntitySchema('node'); diff --git a/core/modules/migrate/tests/src/Kernel/Plugin/EntityExistsTest.php b/core/modules/migrate/tests/src/Kernel/Plugin/EntityExistsTest.php index dcd070c337..b80aa42596 100644 --- a/core/modules/migrate/tests/src/Kernel/Plugin/EntityExistsTest.php +++ b/core/modules/migrate/tests/src/Kernel/Plugin/EntityExistsTest.php @@ -24,7 +24,6 @@ class EntityExistsTest extends KernelTestBase { */ protected function setUp() { parent::setUp(); - $this->installSchema('system', ['sequences']); $this->installEntitySchema('user'); } diff --git a/core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/ContentEntityTest.php b/core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/ContentEntityTest.php index 84bb7cae3b..570d6e4260 100644 --- a/core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/ContentEntityTest.php +++ b/core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/ContentEntityTest.php @@ -103,7 +103,6 @@ protected function setUp() { $this->installEntitySchema('taxonomy_term'); $this->installEntitySchema('taxonomy_vocabulary'); $this->installEntitySchema('user'); - $this->installSchema('system', ['sequences']); $this->installSchema('user', 'users_data'); $this->installSchema('file', 'file_usage'); $this->installSchema('node', ['node_access']); diff --git a/core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php b/core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php index a02853f6e1..49664034f6 100644 --- a/core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php +++ b/core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php @@ -38,7 +38,6 @@ protected function setUp() { $this->installSchema('forum', ['forum_index']); $this->installSchema('node', ['node_access']); $this->installSchema('search', ['search_dataset']); - $this->installSchema('system', ['sequences']); $this->installSchema('tracker', ['tracker_node', 'tracker_user']); // Enable content moderation for nodes of type page. diff --git a/core/modules/migrate_drupal/tests/src/Kernel/d7/MigrateDrupal7AuditIdsTest.php b/core/modules/migrate_drupal/tests/src/Kernel/d7/MigrateDrupal7AuditIdsTest.php index 1693ce1623..132a50cb8c 100644 --- a/core/modules/migrate_drupal/tests/src/Kernel/d7/MigrateDrupal7AuditIdsTest.php +++ b/core/modules/migrate_drupal/tests/src/Kernel/d7/MigrateDrupal7AuditIdsTest.php @@ -38,7 +38,6 @@ protected function setUp() { $this->installSchema('forum', ['forum_index']); $this->installSchema('node', ['node_access']); $this->installSchema('search', ['search_dataset']); - $this->installSchema('system', ['sequences']); $this->installSchema('tracker', ['tracker_node', 'tracker_user']); // Enable content moderation for nodes of type page. diff --git a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTestBase.php b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTestBase.php index e225003d0b..f46e68d6be 100644 --- a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTestBase.php +++ b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTestBase.php @@ -19,7 +19,6 @@ protected function setUp() { $this->installEntitySchema('node'); $this->installConfig(['node']); $this->installSchema('node', ['node_access']); - $this->installSchema('system', ['sequences']); // Create a new user which needs to have UID 1, because that is expected by // the assertions from diff --git a/core/modules/node/tests/src/Kernel/NodeAccessTestBase.php b/core/modules/node/tests/src/Kernel/NodeAccessTestBase.php index 3ee8ba16f3..97473926b3 100644 --- a/core/modules/node/tests/src/Kernel/NodeAccessTestBase.php +++ b/core/modules/node/tests/src/Kernel/NodeAccessTestBase.php @@ -54,7 +54,6 @@ abstract class NodeAccessTestBase extends KernelTestBase { */ protected function setUp() { parent::setUp(); - $this->installSchema('system', 'sequences'); $this->installSchema('node', 'node_access'); $this->installEntitySchema('user'); $this->installEntitySchema('node'); diff --git a/core/modules/node/tests/src/Kernel/NodeBodyFieldStorageTest.php b/core/modules/node/tests/src/Kernel/NodeBodyFieldStorageTest.php index 3dd13496d6..67d65fe955 100644 --- a/core/modules/node/tests/src/Kernel/NodeBodyFieldStorageTest.php +++ b/core/modules/node/tests/src/Kernel/NodeBodyFieldStorageTest.php @@ -23,7 +23,6 @@ class NodeBodyFieldStorageTest extends KernelTestBase { protected function setUp() { parent::setUp(); - $this->installSchema('system', 'sequences'); // Necessary for module uninstall. $this->installSchema('user', 'users_data'); $this->installEntitySchema('user'); diff --git a/core/modules/node/tests/src/Kernel/SummaryLengthTest.php b/core/modules/node/tests/src/Kernel/SummaryLengthTest.php index 7a0d187ac2..8ca4399c76 100644 --- a/core/modules/node/tests/src/Kernel/SummaryLengthTest.php +++ b/core/modules/node/tests/src/Kernel/SummaryLengthTest.php @@ -51,7 +51,6 @@ class SummaryLengthTest extends KernelTestBase { */ protected function setUp() { parent::setUp(); - $this->installSchema('system', 'sequences'); $this->installSchema('node', 'node_access'); $this->installEntitySchema('user'); $this->installEntitySchema('node'); diff --git a/core/modules/node/tests/src/Kernel/Views/FilterUidRevisionTest.php b/core/modules/node/tests/src/Kernel/Views/FilterUidRevisionTest.php index 84dfbacb7d..cb79be5a72 100644 --- a/core/modules/node/tests/src/Kernel/Views/FilterUidRevisionTest.php +++ b/core/modules/node/tests/src/Kernel/Views/FilterUidRevisionTest.php @@ -46,7 +46,6 @@ public function testFilter() { $this->installEntitySchema('user'); $this->installEntitySchema('node'); $this->installEntitySchema('view'); - $this->installSchema('system', ['sequences']); $this->installSchema('node', ['node_access']); $this->installConfig(['filter']); ViewTestData::createTestViews(static::class, ['node_test_views']); diff --git a/core/modules/quickedit/tests/src/Kernel/QuickEditLoadingTest.php b/core/modules/quickedit/tests/src/Kernel/QuickEditLoadingTest.php index ed8e5143d7..5791988d4c 100644 --- a/core/modules/quickedit/tests/src/Kernel/QuickEditLoadingTest.php +++ b/core/modules/quickedit/tests/src/Kernel/QuickEditLoadingTest.php @@ -47,7 +47,6 @@ class QuickEditLoadingTest extends KernelTestBase { protected function setUp() { parent::setUp(); - $this->installSchema('system', 'sequences'); $this->installEntitySchema('user'); $this->installEntitySchema('node'); $this->installConfig(['field', 'filter', 'node']); diff --git a/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php b/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php index fd5702e3ec..738262778c 100644 --- a/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php +++ b/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php @@ -63,9 +63,6 @@ class EntitySerializationTest extends NormalizerTestBase { protected function setUp() { parent::setUp(); - // User create needs sequence table. - $this->installSchema('system', ['sequences']); - FilterFormat::create([ 'format' => 'my_text_format', 'name' => 'My Text Format', diff --git a/core/modules/system/src/Tests/Entity/EntityUnitTestBase.php b/core/modules/system/src/Tests/Entity/EntityUnitTestBase.php index 9997ca5650..54334234e2 100644 --- a/core/modules/system/src/Tests/Entity/EntityUnitTestBase.php +++ b/core/modules/system/src/Tests/Entity/EntityUnitTestBase.php @@ -51,8 +51,6 @@ protected function setUp() { $this->entityManager = $this->container->get('entity.manager'); $this->state = $this->container->get('state'); - $this->installSchema('system', 'sequences'); - $this->installEntitySchema('user'); $this->installEntitySchema('entity_test'); diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 69433cf897..35b7389bf9 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1169,19 +1169,6 @@ function system_schema() { ], ]; - $schema['sequences'] = [ - 'description' => 'Stores IDs.', - 'fields' => [ - 'value' => [ - 'description' => 'The value of the sequence.', - 'type' => 'serial', - 'unsigned' => TRUE, - 'not null' => TRUE, - ], - ], - 'primary key' => ['value'], - ]; - $schema['sessions'] = [ 'description' => "Drupal's session handlers read and write into the sessions table. Each record represents a user session, either anonymous or authenticated.", 'fields' => [ diff --git a/core/modules/system/tests/src/Functional/Entity/EntityReferenceSelection/EntityReferenceSelectionAccessTest.php b/core/modules/system/tests/src/Functional/Entity/EntityReferenceSelection/EntityReferenceSelectionAccessTest.php index 07468af5c5..3f5c6416c8 100644 --- a/core/modules/system/tests/src/Functional/Entity/EntityReferenceSelection/EntityReferenceSelectionAccessTest.php +++ b/core/modules/system/tests/src/Functional/Entity/EntityReferenceSelection/EntityReferenceSelectionAccessTest.php @@ -44,7 +44,6 @@ class EntityReferenceSelectionAccessTest extends KernelTestBase { protected function setUp() { parent::setUp(); - $this->installSchema('system', 'sequences'); $this->installSchema('comment', ['comment_entity_statistics']); $this->installSchema('file', ['file_usage']); diff --git a/core/modules/system/tests/src/Kernel/Action/ActionTest.php b/core/modules/system/tests/src/Kernel/Action/ActionTest.php index dad380079f..5a0bda0b56 100644 --- a/core/modules/system/tests/src/Kernel/Action/ActionTest.php +++ b/core/modules/system/tests/src/Kernel/Action/ActionTest.php @@ -34,7 +34,6 @@ protected function setUp() { $this->actionManager = $this->container->get('plugin.manager.action'); $this->installEntitySchema('user'); - $this->installSchema('system', ['sequences']); } /** diff --git a/core/modules/system/tests/src/Kernel/Block/SystemMenuBlockTest.php b/core/modules/system/tests/src/Kernel/Block/SystemMenuBlockTest.php index 8d0ef50df2..2fc10eab2f 100644 --- a/core/modules/system/tests/src/Kernel/Block/SystemMenuBlockTest.php +++ b/core/modules/system/tests/src/Kernel/Block/SystemMenuBlockTest.php @@ -83,7 +83,6 @@ class SystemMenuBlockTest extends KernelTestBase { */ protected function setUp() { parent::setUp(); - $this->installSchema('system', 'sequences'); $this->installEntitySchema('user'); $this->installEntitySchema('menu_link_content'); diff --git a/core/modules/system/tests/src/Kernel/DateFormatAccessControlHandlerTest.php b/core/modules/system/tests/src/Kernel/DateFormatAccessControlHandlerTest.php index 932fbebf9e..da3478bf59 100644 --- a/core/modules/system/tests/src/Kernel/DateFormatAccessControlHandlerTest.php +++ b/core/modules/system/tests/src/Kernel/DateFormatAccessControlHandlerTest.php @@ -43,7 +43,6 @@ protected function setUp() { parent::setUp(); $this->installEntitySchema('date_format'); $this->installEntitySchema('user'); - $this->installSchema('system', 'sequences'); $this->accessControlHandler = $this->container->get('entity_type.manager')->getAccessControlHandler('date_format'); } diff --git a/core/modules/system/tests/src/Kernel/MenuAccessControlHandlerTest.php b/core/modules/system/tests/src/Kernel/MenuAccessControlHandlerTest.php index 143e31d558..b001dc50b1 100644 --- a/core/modules/system/tests/src/Kernel/MenuAccessControlHandlerTest.php +++ b/core/modules/system/tests/src/Kernel/MenuAccessControlHandlerTest.php @@ -43,7 +43,6 @@ protected function setUp() { parent::setUp(); $this->installEntitySchema('menu'); $this->installEntitySchema('user'); - $this->installSchema('system', 'sequences'); $this->accessControlHandler = $this->container->get('entity_type.manager')->getAccessControlHandler('menu'); } diff --git a/core/modules/system/tests/src/Kernel/TimezoneResolverTest.php b/core/modules/system/tests/src/Kernel/TimezoneResolverTest.php index 7c7f889ed4..5f711ddd5a 100644 --- a/core/modules/system/tests/src/Kernel/TimezoneResolverTest.php +++ b/core/modules/system/tests/src/Kernel/TimezoneResolverTest.php @@ -30,7 +30,6 @@ class TimezoneResolverTest extends KernelTestBase { */ public function testGetTimeZone() { $this->installEntitySchema('user'); - $this->installSchema('system', ['sequences']); $this->installConfig(['system']); // Check the default test timezone. diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTranslationTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTranslationTest.php index 51efcd35d7..b4a73c8db9 100644 --- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTranslationTest.php +++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTranslationTest.php @@ -33,7 +33,6 @@ protected function setUp() { $this->installEntitySchema('node'); $this->installConfig(['node']); $this->installSchema('node', ['node_access']); - $this->installSchema('system', ['sequences']); $this->executeMigration('d6_node_settings'); $this->migrateUsers(FALSE); diff --git a/core/modules/tracker/tests/src/Kernel/Views/TrackerUserUidTest.php b/core/modules/tracker/tests/src/Kernel/Views/TrackerUserUidTest.php index 7434051d52..72bb876233 100644 --- a/core/modules/tracker/tests/src/Kernel/Views/TrackerUserUidTest.php +++ b/core/modules/tracker/tests/src/Kernel/Views/TrackerUserUidTest.php @@ -44,7 +44,6 @@ class TrackerUserUidTest extends KernelTestBase { * Tests the user uid filter and argument. */ public function testUserUid() { - $this->installSchema('system', ['sequences']); $this->installConfig(['filter']); $this->installEntitySchema('user'); $this->installEntitySchema('node'); diff --git a/core/modules/user/tests/src/Kernel/Condition/UserRoleConditionTest.php b/core/modules/user/tests/src/Kernel/Condition/UserRoleConditionTest.php index d6923faf97..041e3f379f 100644 --- a/core/modules/user/tests/src/Kernel/Condition/UserRoleConditionTest.php +++ b/core/modules/user/tests/src/Kernel/Condition/UserRoleConditionTest.php @@ -56,7 +56,6 @@ class UserRoleConditionTest extends KernelTestBase { protected function setUp() { parent::setUp(); - $this->installSchema('system', 'sequences'); $this->installEntitySchema('user'); $this->manager = $this->container->get('plugin.manager.condition'); diff --git a/core/modules/user/tests/src/Kernel/ContextProvider/CurrentUserContextTest.php b/core/modules/user/tests/src/Kernel/ContextProvider/CurrentUserContextTest.php index be9e829e4e..f8c389410d 100644 --- a/core/modules/user/tests/src/Kernel/ContextProvider/CurrentUserContextTest.php +++ b/core/modules/user/tests/src/Kernel/ContextProvider/CurrentUserContextTest.php @@ -24,7 +24,6 @@ class CurrentUserContextTest extends KernelTestBase { protected function setUp() { parent::setUp(); - $this->installSchema('system', ['sequences']); $this->installEntitySchema('user'); } diff --git a/core/modules/user/tests/src/Kernel/Field/UserNameFormatterTest.php b/core/modules/user/tests/src/Kernel/Field/UserNameFormatterTest.php index 6beecb88d3..160e5cb643 100644 --- a/core/modules/user/tests/src/Kernel/Field/UserNameFormatterTest.php +++ b/core/modules/user/tests/src/Kernel/Field/UserNameFormatterTest.php @@ -44,7 +44,6 @@ protected function setUp() { $this->installConfig(['field']); $this->installEntitySchema('user'); - $this->installSchema('system', ['sequences']); $this->entityType = 'user'; $this->bundle = $this->entityType; diff --git a/core/modules/user/tests/src/Kernel/Migrate/MigrateUserStubTest.php b/core/modules/user/tests/src/Kernel/Migrate/MigrateUserStubTest.php index 768f5d72c8..385983abe8 100644 --- a/core/modules/user/tests/src/Kernel/Migrate/MigrateUserStubTest.php +++ b/core/modules/user/tests/src/Kernel/Migrate/MigrateUserStubTest.php @@ -25,7 +25,6 @@ class MigrateUserStubTest extends MigrateDrupalTestBase { protected function setUp() { parent::setUp(); $this->installEntitySchema('user'); - $this->installSchema('system', ['sequences']); } /** diff --git a/core/modules/user/tests/src/Kernel/UserDeleteTest.php b/core/modules/user/tests/src/Kernel/UserDeleteTest.php index 928c095ec2..f673060faa 100644 --- a/core/modules/user/tests/src/Kernel/UserDeleteTest.php +++ b/core/modules/user/tests/src/Kernel/UserDeleteTest.php @@ -28,7 +28,6 @@ class UserDeleteTest extends KernelTestBase { * Test deleting multiple users. */ public function testUserDeleteMultiple() { - $this->installSchema('system', ['sequences']); $this->installSchema('user', ['users_data']); $this->installEntitySchema('user'); diff --git a/core/modules/user/tests/src/Kernel/UserEntityLabelTest.php b/core/modules/user/tests/src/Kernel/UserEntityLabelTest.php index 625631e0ef..2fb88d47ab 100644 --- a/core/modules/user/tests/src/Kernel/UserEntityLabelTest.php +++ b/core/modules/user/tests/src/Kernel/UserEntityLabelTest.php @@ -28,7 +28,6 @@ class UserEntityLabelTest extends KernelTestBase { * Tests label callback. */ public function testLabelCallback() { - $this->installSchema('system', ['sequences']); $this->installEntitySchema('user'); $account = $this->createUser(); diff --git a/core/modules/user/tests/src/Kernel/UserLegacyTest.php b/core/modules/user/tests/src/Kernel/UserLegacyTest.php index fb7fa30966..c70eec9b1b 100644 --- a/core/modules/user/tests/src/Kernel/UserLegacyTest.php +++ b/core/modules/user/tests/src/Kernel/UserLegacyTest.php @@ -35,7 +35,6 @@ protected function setUp() { * @expectedDeprecation user_load() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\user\Entity\User::load(). See https://www.drupal.org/node/2266845 */ public function testEntityLegacyCode() { - $this->installSchema('system', ['sequences']); $this->assertCount(0, user_load_multiple()); User::create(['name' => 'foo'])->save(); $this->assertCount(1, user_load_multiple()); diff --git a/core/modules/user/tests/src/Kernel/UserSaveTest.php b/core/modules/user/tests/src/Kernel/UserSaveTest.php index dfdd13a5be..ea2f03f5a4 100644 --- a/core/modules/user/tests/src/Kernel/UserSaveTest.php +++ b/core/modules/user/tests/src/Kernel/UserSaveTest.php @@ -24,7 +24,6 @@ class UserSaveTest extends KernelTestBase { * Ensures that an existing password is unset after the user was saved. */ public function testExistingPasswordRemoval() { - $this->installSchema('system', ['sequences']); $this->installEntitySchema('user'); /** @var \Drupal\user\Entity\User $user */ diff --git a/core/modules/user/tests/src/Kernel/UserValidationTest.php b/core/modules/user/tests/src/Kernel/UserValidationTest.php index 7435b35e28..1e1b566912 100644 --- a/core/modules/user/tests/src/Kernel/UserValidationTest.php +++ b/core/modules/user/tests/src/Kernel/UserValidationTest.php @@ -30,7 +30,6 @@ class UserValidationTest extends KernelTestBase { protected function setUp() { parent::setUp(); $this->installEntitySchema('user'); - $this->installSchema('system', ['sequences']); // Make sure that the default roles exist. $this->installConfig(['user']); diff --git a/core/modules/user/tests/src/Kernel/Views/AccessPermissionTest.php b/core/modules/user/tests/src/Kernel/Views/AccessPermissionTest.php index 65e6eda800..ffeade8276 100644 --- a/core/modules/user/tests/src/Kernel/Views/AccessPermissionTest.php +++ b/core/modules/user/tests/src/Kernel/Views/AccessPermissionTest.php @@ -56,7 +56,6 @@ class AccessPermissionTest extends KernelTestBase { protected function setUp() { parent::setUp(); - $this->installSchema('system', ['sequences']); $this->installEntitySchema('user'); $this->installEntitySchema('node'); diff --git a/core/modules/user/tests/src/Kernel/Views/ArgumentDefaultTest.php b/core/modules/user/tests/src/Kernel/Views/ArgumentDefaultTest.php index c1e91b3b71..000b01370b 100644 --- a/core/modules/user/tests/src/Kernel/Views/ArgumentDefaultTest.php +++ b/core/modules/user/tests/src/Kernel/Views/ArgumentDefaultTest.php @@ -38,7 +38,6 @@ class ArgumentDefaultTest extends KernelTestBase { * Tests the current user with argument default. */ public function testPluginArgumentDefaultCurrentUser() { - $this->installSchema('system', ['sequences']); $this->installEntitySchema('user'); ViewTestData::createTestViews(get_class($this), ['user_test_views']); diff --git a/core/modules/user/tests/src/Kernel/Views/HandlerArgumentUserUidTest.php b/core/modules/user/tests/src/Kernel/Views/HandlerArgumentUserUidTest.php index dc51ed9946..f7b27cea28 100644 --- a/core/modules/user/tests/src/Kernel/Views/HandlerArgumentUserUidTest.php +++ b/core/modules/user/tests/src/Kernel/Views/HandlerArgumentUserUidTest.php @@ -38,7 +38,6 @@ class HandlerArgumentUserUidTest extends KernelTestBase { * Tests the generated title of an user: uid argument. */ public function testArgumentTitle() { - $this->installSchema('system', ['sequences']); $this->installEntitySchema('user'); $this->installConfig(['user']); User::create(['uid' => 0, 'name' => ''])->save(); diff --git a/core/modules/user/tests/src/Kernel/Views/RelationshipRepresentativeNodeTest.php b/core/modules/user/tests/src/Kernel/Views/RelationshipRepresentativeNodeTest.php index 6a067f259e..6bf3c09cf1 100644 --- a/core/modules/user/tests/src/Kernel/Views/RelationshipRepresentativeNodeTest.php +++ b/core/modules/user/tests/src/Kernel/Views/RelationshipRepresentativeNodeTest.php @@ -43,7 +43,6 @@ class RelationshipRepresentativeNodeTest extends KernelTestBase { * Tests the relationship. */ public function testRelationship() { - $this->installSchema('system', ['sequences']); $this->installEntitySchema('user'); $this->installEntitySchema('node'); $this->installConfig(['filter']); diff --git a/core/modules/user/tests/src/Kernel/WhosOnlineBlockTest.php b/core/modules/user/tests/src/Kernel/WhosOnlineBlockTest.php index 85283c68fa..746f553e0d 100644 --- a/core/modules/user/tests/src/Kernel/WhosOnlineBlockTest.php +++ b/core/modules/user/tests/src/Kernel/WhosOnlineBlockTest.php @@ -45,7 +45,6 @@ class WhosOnlineBlockTest extends KernelTestBase { protected function setUp() { parent::setUp(); $this->installConfig(['system', 'block', 'views', 'user']); - $this->installSchema('system', ['sequences']); $this->installEntitySchema('user'); $this->controller = $this->container diff --git a/core/modules/user/tests/src/Traits/UserCreationTrait.php b/core/modules/user/tests/src/Traits/UserCreationTrait.php index 9d687fd4e5..95df764a57 100644 --- a/core/modules/user/tests/src/Traits/UserCreationTrait.php +++ b/core/modules/user/tests/src/Traits/UserCreationTrait.php @@ -59,7 +59,8 @@ protected function setUpCurrentUser(array $values = [], array $permissions = [], } if ($this instanceof KernelTestBase && (!isset($values['uid']) || $values['uid'])) { try { - $this->installSchema('system', ['sequences']); + // This will ensure sequences table created. + \Drupal::database()->nextId(); } catch (SchemaObjectExistsException $e) { } diff --git a/core/modules/views/src/Tests/ViewKernelTestBase.php b/core/modules/views/src/Tests/ViewKernelTestBase.php index 4e1aa08029..71b9017138 100644 --- a/core/modules/views/src/Tests/ViewKernelTestBase.php +++ b/core/modules/views/src/Tests/ViewKernelTestBase.php @@ -42,7 +42,6 @@ abstract class ViewKernelTestBase extends KernelTestBase { protected function setUp($import_test_views = TRUE) { parent::setUp(); - $this->installSchema('system', ['sequences']); $this->setUpFixtures(); if ($import_test_views) { diff --git a/core/modules/views/tests/src/Kernel/ViewsKernelTestBase.php b/core/modules/views/tests/src/Kernel/ViewsKernelTestBase.php index 6d1ee400dd..ae3133df65 100644 --- a/core/modules/views/tests/src/Kernel/ViewsKernelTestBase.php +++ b/core/modules/views/tests/src/Kernel/ViewsKernelTestBase.php @@ -41,7 +41,7 @@ abstract class ViewsKernelTestBase extends KernelTestBase { protected function setUp($import_test_views = TRUE) { parent::setUp(); - $this->installSchema('system', ['sequences', 'key_value_expire']); + $this->installSchema('system', ['key_value_expire']); $this->setUpFixtures(); if ($import_test_views) { diff --git a/core/modules/workflows/tests/src/Kernel/WorkflowAccessControlHandlerTest.php b/core/modules/workflows/tests/src/Kernel/WorkflowAccessControlHandlerTest.php index eb7bdae95f..4b97e8bcc3 100644 --- a/core/modules/workflows/tests/src/Kernel/WorkflowAccessControlHandlerTest.php +++ b/core/modules/workflows/tests/src/Kernel/WorkflowAccessControlHandlerTest.php @@ -56,7 +56,6 @@ protected function setUp() { $this->installEntitySchema('workflow'); $this->installEntitySchema('user'); - $this->installSchema('system', ['sequences']); $this->accessControlHandler = $this->container->get('entity_type.manager')->getAccessControlHandler('workflow'); diff --git a/core/modules/workspaces/tests/src/Kernel/EntityReferenceSupportedNewEntitiesConstraintValidatorTest.php b/core/modules/workspaces/tests/src/Kernel/EntityReferenceSupportedNewEntitiesConstraintValidatorTest.php index 5cef79df93..799a5fd84b 100644 --- a/core/modules/workspaces/tests/src/Kernel/EntityReferenceSupportedNewEntitiesConstraintValidatorTest.php +++ b/core/modules/workspaces/tests/src/Kernel/EntityReferenceSupportedNewEntitiesConstraintValidatorTest.php @@ -34,7 +34,6 @@ protected function setUp() { parent::setUp(); $this->installEntitySchema('user'); - $this->installSchema('system', ['sequences']); $this->createUser(); $fields['supported_reference'] = BaseFieldDefinition::create('entity_reference')->setSetting('target_type', 'entity_test_mulrevpub'); diff --git a/core/modules/workspaces/tests/src/Kernel/WorkspaceAccessTest.php b/core/modules/workspaces/tests/src/Kernel/WorkspaceAccessTest.php index f8a4964eda..777e483016 100644 --- a/core/modules/workspaces/tests/src/Kernel/WorkspaceAccessTest.php +++ b/core/modules/workspaces/tests/src/Kernel/WorkspaceAccessTest.php @@ -30,8 +30,6 @@ class WorkspaceAccessTest extends KernelTestBase { protected function setUp() { parent::setUp(); - $this->installSchema('system', ['sequences']); - $this->installEntitySchema('workspace'); $this->installEntitySchema('user'); diff --git a/core/modules/workspaces/tests/src/Kernel/WorkspaceIntegrationTest.php b/core/modules/workspaces/tests/src/Kernel/WorkspaceIntegrationTest.php index 1530f38658..24d8cd1b22 100644 --- a/core/modules/workspaces/tests/src/Kernel/WorkspaceIntegrationTest.php +++ b/core/modules/workspaces/tests/src/Kernel/WorkspaceIntegrationTest.php @@ -83,7 +83,7 @@ protected function setUp() { $this->installConfig(['filter', 'node', 'system', 'language', 'content_translation']); - $this->installSchema('system', ['key_value_expire', 'sequences']); + $this->installSchema('system', ['key_value_expire']); $this->installSchema('node', ['node_access']); $language = ConfigurableLanguage::createFromLangcode('de'); diff --git a/core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php b/core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php index e5a2bd95da..70e846a267 100644 --- a/core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php +++ b/core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php @@ -27,7 +27,7 @@ protected function setUp() { parent::setUp(); $this->installEntitySchema('entity_test_mulrevpub'); $this->installEntitySchema('user'); - $this->installSchema('system', ['sequences', 'key_value_expire']); + $this->installSchema('system', ['key_value_expire']); $this->testUser = User::create([ 'name' => 'foobar', diff --git a/core/tests/Drupal/KernelTests/Core/Cache/CacheContextOptimizationTest.php b/core/tests/Drupal/KernelTests/Core/Cache/CacheContextOptimizationTest.php index 4739b6238a..a91cfb9693 100644 --- a/core/tests/Drupal/KernelTests/Core/Cache/CacheContextOptimizationTest.php +++ b/core/tests/Drupal/KernelTests/Core/Cache/CacheContextOptimizationTest.php @@ -29,7 +29,6 @@ protected function setUp() { parent::setUp(); $this->installEntitySchema('user'); $this->installConfig(['user']); - $this->installSchema('system', ['sequences']); } /** diff --git a/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php b/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php index 47fa613ab2..4263220a36 100644 --- a/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php +++ b/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php @@ -94,7 +94,6 @@ protected function setUp() { $this->installEntitySchema('file'); $this->installEntitySchema('menu_link_content'); $this->installEntitySchema('path_alias'); - $this->installSchema('system', 'sequences'); // Place some sample config to test for in the export. $this->data = [ @@ -133,7 +132,6 @@ protected function setUp() { 'menu_link_content_data', 'menu_link_content_revision', 'menu_link_content_field_revision', - 'sequences', 'sessions', 'path_alias', 'path_alias_revision', @@ -201,6 +199,8 @@ public function testScriptLoad() { $this->originalTableIndexes[$table] = $this->getTableIndexes($table); $schema->dropTable($table); } + // Special handling of sequences table which is created on demand. + $schema->dropTable('sequences'); // This will load the data. $file = sys_get_temp_dir() . '/' . $this->randomMachineName(); diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterMissingContentTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterMissingContentTest.php index c67e0425da..d80248dc72 100644 --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterMissingContentTest.php +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterMissingContentTest.php @@ -30,7 +30,6 @@ class ConfigImporterMissingContentTest extends KernelTestBase { protected function setUp() { parent::setUp(); - $this->installSchema('system', 'sequences'); $this->installEntitySchema('entity_test'); $this->installEntitySchema('user'); $this->installConfig(['system', 'config_test']); diff --git a/core/tests/Drupal/KernelTests/Core/Database/DatabaseLegacyTest.php b/core/tests/Drupal/KernelTests/Core/Database/DatabaseLegacyTest.php index 249b057006..1ab6931e22 100644 --- a/core/tests/Drupal/KernelTests/Core/Database/DatabaseLegacyTest.php +++ b/core/tests/Drupal/KernelTests/Core/Database/DatabaseLegacyTest.php @@ -111,7 +111,6 @@ public function testDbDropTable() { * @expectedDeprecation db_next_id() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container and call nextId() on it. For example, $injected_database->nextId($existing_id). See https://www.drupal.org/node/2993033 */ public function testDbNextId() { - $this->installSchema('system', 'sequences'); $this->assertEquals(1001, db_next_id(1000)); } diff --git a/core/tests/Drupal/KernelTests/Core/Database/NextIdTest.php b/core/tests/Drupal/KernelTests/Core/Database/NextIdTest.php index 9adb214b92..650b1f743e 100644 --- a/core/tests/Drupal/KernelTests/Core/Database/NextIdTest.php +++ b/core/tests/Drupal/KernelTests/Core/Database/NextIdTest.php @@ -16,14 +16,6 @@ class NextIdTest extends DatabaseTestBase { */ public static $modules = ['database_test', 'system']; - /** - * {@inheritdoc} - */ - protected function setUp() { - parent::setUp(); - $this->installSchema('system', 'sequences'); - } - /** * Tests that the sequences API works. */ diff --git a/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php b/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php index c4a2f349cf..e78e2953eb 100644 --- a/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php +++ b/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php @@ -337,8 +337,6 @@ public function testJoinTwice() { * Tests that we can join on a query. */ public function testJoinSubquery() { - $this->installSchema('system', 'sequences'); - $account = User::create([ 'name' => $this->randomMachineName(), 'mail' => $this->randomMachineName() . '@example.com', diff --git a/core/tests/Drupal/KernelTests/Core/Element/PathElementFormTest.php b/core/tests/Drupal/KernelTests/Core/Element/PathElementFormTest.php index b5b9ffd5ec..1deb666279 100644 --- a/core/tests/Drupal/KernelTests/Core/Element/PathElementFormTest.php +++ b/core/tests/Drupal/KernelTests/Core/Element/PathElementFormTest.php @@ -37,7 +37,7 @@ class PathElementFormTest extends KernelTestBase implements FormInterface { */ protected function setUp() { parent::setUp(); - $this->installSchema('system', ['sequences', 'key_value_expire']); + $this->installSchema('system', ['key_value_expire']); $this->installEntitySchema('user'); \Drupal::service('router.builder')->rebuild(); /** @var \Drupal\user\RoleInterface $role */ diff --git a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityHasChangesTest.php b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityHasChangesTest.php index 687ceb74c0..5af55211be 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityHasChangesTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityHasChangesTest.php @@ -32,7 +32,6 @@ protected function setUp() { $this->installEntitySchema('user'); $this->installEntitySchema('entity_test_mulrev_chnged_revlog'); - $this->installSchema('system', 'sequences'); } /** diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBase.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBase.php index 27edf6bce8..f03c41df0c 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBase.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBase.php @@ -63,8 +63,6 @@ protected function setUp() { $this->entityTypeManager = $this->container->get('entity_type.manager'); $this->state = $this->container->get('state'); - $this->installSchema('system', 'sequences'); - $this->installEntitySchema('user'); $this->installEntitySchema('entity_test'); diff --git a/core/tests/Drupal/KernelTests/Core/Form/ExternalFormUrlTest.php b/core/tests/Drupal/KernelTests/Core/Form/ExternalFormUrlTest.php index f3fbc4f76c..1b83cdd781 100644 --- a/core/tests/Drupal/KernelTests/Core/Form/ExternalFormUrlTest.php +++ b/core/tests/Drupal/KernelTests/Core/Form/ExternalFormUrlTest.php @@ -53,7 +53,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {} */ protected function setUp() { parent::setUp(); - $this->installSchema('system', ['key_value_expire', 'sequences']); + $this->installSchema('system', ['key_value_expire']); $this->installEntitySchema('user'); $test_user = User::create([ diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/Condition/ConditionTestDualUserTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/Condition/ConditionTestDualUserTest.php index b0aece9a10..f41baa5982 100644 --- a/core/tests/Drupal/KernelTests/Core/Plugin/Condition/ConditionTestDualUserTest.php +++ b/core/tests/Drupal/KernelTests/Core/Plugin/Condition/ConditionTestDualUserTest.php @@ -38,7 +38,6 @@ class ConditionTestDualUserTest extends KernelTestBase { protected function setUp() { parent::setUp(); - $this->installSchema('system', 'sequences'); $this->installEntitySchema('user'); $this->anonymous = User::create(['uid' => 0]); diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/Condition/RequestPathTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/Condition/RequestPathTest.php index f9b56859d4..e6f6ceceb4 100644 --- a/core/tests/Drupal/KernelTests/Core/Plugin/Condition/RequestPathTest.php +++ b/core/tests/Drupal/KernelTests/Core/Plugin/Condition/RequestPathTest.php @@ -57,8 +57,6 @@ class RequestPathTest extends KernelTestBase { protected function setUp() { parent::setUp(); - $this->installSchema('system', ['sequences']); - $this->pluginManager = $this->container->get('plugin.manager.condition'); // Set a mock alias manager in the container. diff --git a/core/tests/Drupal/KernelTests/Core/Queue/QueueSerializationTest.php b/core/tests/Drupal/KernelTests/Core/Queue/QueueSerializationTest.php index b4e122b4b7..e3bbfccc8d 100644 --- a/core/tests/Drupal/KernelTests/Core/Queue/QueueSerializationTest.php +++ b/core/tests/Drupal/KernelTests/Core/Queue/QueueSerializationTest.php @@ -77,7 +77,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { */ protected function setUp() { parent::setUp(); - $this->installSchema('system', ['key_value_expire', 'sequences']); + $this->installSchema('system', ['key_value_expire']); $this->installEntitySchema('user'); $this->queue = \Drupal::service('queue.database')->get('aggregator_refresh'); $test_user = User::create([ diff --git a/core/tests/Drupal/KernelTests/Core/Render/RenderCacheTest.php b/core/tests/Drupal/KernelTests/Core/Render/RenderCacheTest.php index 3beed66fa6..8d25a69b85 100644 --- a/core/tests/Drupal/KernelTests/Core/Render/RenderCacheTest.php +++ b/core/tests/Drupal/KernelTests/Core/Render/RenderCacheTest.php @@ -28,7 +28,6 @@ protected function setUp() { parent::setUp(); $this->installEntitySchema('user'); $this->installConfig(['user']); - $this->installSchema('system', ['sequences']); } /** diff --git a/core/tests/Drupal/KernelTests/Core/Theme/TwigWhiteListTest.php b/core/tests/Drupal/KernelTests/Core/Theme/TwigWhiteListTest.php index 0a3b3ed66e..651ef040f3 100644 --- a/core/tests/Drupal/KernelTests/Core/Theme/TwigWhiteListTest.php +++ b/core/tests/Drupal/KernelTests/Core/Theme/TwigWhiteListTest.php @@ -43,7 +43,6 @@ class TwigWhiteListTest extends KernelTestBase { protected function setUp() { parent::setUp(); \Drupal::service('theme_installer')->install(['test_theme']); - $this->installSchema('system', ['sequences']); $this->installEntitySchema('node'); $this->installEntitySchema('user'); $this->installEntitySchema('taxonomy_term');