Deprecate Drupal\Core\Database\Connection::nextId() and the {sequences} table and schema

Created on 9 February 2016, almost 9 years ago
Updated 8 June 2023, over 1 year ago

Problem/Motivation

The method Drupal\Core\Database\Connection::nextId() is programmed that it only works when it is used for a single sequence. It is not used in core since 10.2 📌 Fix batch process race conditions by making ‘bid (batch id)’ auto-increment Fixed . When a contrib or custom module starts using the method and sets the sequence ID for getting a new ID, the change is very high that sooner then later that the database will throw an error that insert a record with an existing ID.

Proposed resolution

Deprecate the method Drupal\Core\Database\Connection::nextId() and the {sequences} table. Modules should use autoincrement tables where necessary.

Remaining tasks

review/commit

User interface changes

no

API changes

  • The method Drupal\Core\Database\Connection::nextId() is deprecated and removed in Drupal 11;
  • The method Drupal\mysql\Driver\Database\mysql\nextIdDelete() is deprecated and removed in Drupal 11;
  • The sequences table is deprecated and removed in Drupal 12;
  • Calling KernelTestBase::installSchema() for the table {sequences} is deprecated.

Data model changes

📌 Task
Status

Fixed

Version

11.0 🔥

Component
Base 

Last updated about 1 hour ago

Created by

🇩🇪Germany dawehner

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024