gmemstr / database-janitor

custommized database dumps, with native drupal configuration support
Mozilla Public License 2.0
3 stars 5 forks source link

CLI process for generating janitor configuration #18

Open gmemstr opened 5 years ago

gmemstr commented 5 years ago

Since the inclusion of additional YML files within the main config (#17) it's probably worth looking into writing a command line flag and letting it run through the database itself (interactively or otherwise?) to generate a janitor.yml file. I'm not 100% sure the logistics of this since it's not high on my list of priorities but is something to consider.

travis-bradbury commented 4 years ago

https://www.drupal.org/project/entity_strip can help generate tables to exclude. It's a drush command for finding the tables related to entity types.

gmemstr commented 4 years ago

@travis-bradbury Maybe something we could work with natively in some way (e.g convert the data into a format we can use in the config) - would you be able to post some sample output for it?

travis-bradbury commented 4 years ago

It had a couple output options but one is yml.

$ drush des user some_entity --format="yml" --parent-key="scrub_tables"
scrub_tables:
  - user
  - some_entity
  - field_data_field_whatever
  - field_revision_field_whatever
gmemstr commented 4 years ago

Neat - I think we could include this in the README at the very least since it seems like something that would be relatively easy to pipe into a secondary file to be included.