Provide a way to to alter the AUTO_INCREMENT for a single entity

Created on 15 November 2024, about 1 month ago

Currently the module allows setting the AUTO_INCREMENT value of a single database table. Example:

drush php:eval "\Drupal::service('auto_increment_alter.mysql')->alterTable('node', 500);"

Let's add a new method called alterEntityTables which accepts the entity name, base table alter value, and revision table alter value. Similar to alterContentEntities. If the content entity uses a revision table, but the parameter is not set, the same value from the base table shall be used. Some content entities do not make use of revision tables. In those cases, the revision value is ignored even if set.

Examples:

drush php:eval "print_r(array_keys(\Drupal::service('auto_increment_alter.mysql')->alterEntityTables('node', 500, 100)));"
drush php:eval "print_r(array_keys(\Drupal::service('auto_increment_alter.mysql')->alterEntityTables('taxonomy_term', 200)));"
drush php:eval "print_r(array_keys(\Drupal::service('auto_increment_alter.mysql')->alterEntityTables('file', 300)));"
Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇳🇮Nicaragua dinarcon

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024