Currently the module allows getting a list of entities present in the Drupal installation. Examples:

drush php:eval "print_r(array_keys(\Drupal::service('auto_increment_alter.mysql')->getEntityList()));"
drush php:eval "print_r(array_keys(\Drupal::service('auto_increment_alter.mysql')->getEntityList('content')));"
drush php:eval "print_r(array_keys(\Drupal::service('auto_increment_alter.mysql')->getEntityList('configuration')));"

Let's have a way to get a list of tables. This can be used to set the incremental value for a single table with something like

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

Let's add a new method called getTableList which returns an array of table names.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dinarcon created an issue. See original summary.

gaurav_manerkar’s picture

Assigned: Unassigned » gaurav_manerkar

gaurav_manerkar’s picture

Assigned: gaurav_manerkar » Unassigned
Status: Active » Needs review

Please review mr.

baltowen made their first commit to this issue’s fork.

baltowen’s picture

Thanks @gaurav_manerkar to start working on this. I moved the implementation of getTableList method to the AutoIncrementAlterMysql class. SHOW TABLES is specific to MySQL. It would not work in PostgreSQL nor SQLite.

dinarcon’s picture

Status: Needs review » Fixed

Reviewed and tested. Working as expected. Thanks @gaurav_manerkar and @baltowen

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.