A serial/primary key field can not be added to an existing table for some databases

Created on 14 November 2015, about 9 years ago
Updated 6 December 2024, 20 days ago

Problem/Motivation

- DBTNG does not support adding a serial field to an existing table, even if all the supported DB engines can do that just fine
- DBTNG does not handle primary keys properly when adding a new field to an existing table. \Drupal\Core\Database\Schema::changeField() documents that primary keys have to be handled manually by the calling code, but \Drupal\Core\Database\Schema::addField() documents that it handles primary keys by itself.

Proposed resolution

Fix DBTNG to support adding a serial field to an existing table.

Fix implementations of \Drupal\Core\Database\Schema::addField() to handle primary key changes automatically.

Remaining tasks

Review.

User interface changes

Nope.

API changes

Nope.

Data model changes

Nope.

🐛 Bug report
Status

Needs review

Version

7.0 ⚰️

Component

database system

Created by

🇨🇳China dustise

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