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.
Issue fork auto_increment_alter-3487881
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
Comment #2
gaurav_manerkar commentedComment #4
gaurav_manerkar commentedPlease review mr.
Comment #6
baltowen commentedThanks @gaurav_manerkar to start working on this. I moved the implementation of
getTableListmethod to theAutoIncrementAlterMysqlclass. SHOW TABLES is specific to MySQL. It would not work in PostgreSQL nor SQLite.Comment #8
dinarcon commentedReviewed and tested. Working as expected. Thanks @gaurav_manerkar and @baltowen