Problem/Motivation
Right now, updating or maintaining the migration database fixtures is very, very painful and time-consuming task. After a dev exported an updated database fixture, it's very hard to distinguish which changes we want to commit, and which ones we should revert (manually).
Steps to reproduce
Based on the system module's schema, right now the core D7 DB fixture contains a Drupal 7.44 database. Refresh it to the most recent one (7.80), execute database updates, and then export the updated database with
php core/scripts/db-tools.php dump --database fixture_connection > core/modules/migrate_drupal/tests/fixtures/drupal7.php
(See Generating database fixtures for migration tests).
Proposed resolution
Add a new option for the DbDumpCommand which then generates a set of per-table fixture files.
Remaining tasks
- Patch
- Doc update
- Updating the core fixtures (maybe this should happen in a follow-up?)
User interface changes
Nothing
API changes
New option for DbDumpCommand.
Data model changes
Nothing.
Release notes snippet
TBD.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | core-option_creating_db_fixture_split_per_table-3213633-2.patch | 9.34 KB | huzooka |
Comments
Comment #2
huzookaI also added a new test for testing the new option; this test now extends the preexisting
DbDumpCommandTest.Comment #3
huzookaComment #6
quietone commentedI played with this today and I think this is a good idea. While at first it seemed overwhelming to have all the individual files, it will help one to select the tables needed when updating the database and avoid the irrelevant ones which will have lots of changes.
This could use a more intuitive option name. Or at least for me. May 'per-table'? I don't know.
Also, the 'destination file' is a directory not a file.
While this will help migrate I am changing component to the database update system, like the related issue.
Comment #7
xjmComment #9
papagrandeComment #10
damienmckennaShould I open a separate issue for the problem of certain data structures being stored as serialized arrays with embedded objects ("config" and "key_value" values especially), which makes fixture files extremely complex?
Comment #12
quietone commentedNow that Migrate Drupal is deprecated this isn't needed for that use case. Change to won't fix?
Comment #13
smustgrave commentedThink so, credit was already saved for the patch attempt FYI.