Problem/Motivation
Currently, the core/scripts/dump-database-d8-mysql.php
script takes no options, and dumps everything aside from a few excluded tables, and some data (eg cache tables) are excluded.
When working on tests for #2544954: SqlContentEntityStorageSchema does not detect column-level schema changes in non-base-fields, it will be very nice to be able to say only export data for these certain tables (then the test can load an additional file that doesn't include the table create statement). Similarly, only exporting schema for a list of tables will also be useful.
This is by no means urgent, as this can be done by hand currently, but it would be nice DX for future upgrade path issues.
Proposed resolution
Add --schema-only
and --data-only
options, and an optional tables
argument.
The new command could, for instance, export just the node and node_field_data insert statements using:
./dump-database-d8-mysql.php --data-only node node_field_data
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#24 | interdiff_22-24.txt | 1.85 KB | sahil.goyal |
#24 | 2544972-24.patch | 5.2 KB | sahil.goyal |
#22 | interdiff-2544972-19-22.txt | 1013 bytes | markdorison |
#22 | 2544972-22.patch | 4.01 KB | markdorison |
#21 | 2544972-nr-bot.txt | 1.31 KB | needs-review-queue-bot |
Comments
Comment #1
jhedstromComment #3
markdorisonPatch no longer applies cleanly. I believe the schema-only option may have already been implemented.
Comment #9
BerdirDidn't update the tests yet, but this is a data-only command similar to the existing schema-only option. They are mutually exclusive, using any data-only arguments will only export data for only those tables.
Comment #16
quietone CreditAttribution: quietone at PreviousNext commentedAdding a related issue, which may be a duplicate. Maybe I can look later, unless someone does that before I get back here.
Comment #17
quietone CreditAttribution: quietone at PreviousNext commentedLooked into the more today and the related issue added in #16 is not a duplicate.
While this may be useful for working with dumps this issue itself does not need an upgrade path, so removing tag.
Comment #18
Anchal_gupta CreditAttribution: Anchal_gupta at Srijan | A Material+ Company for Drupal India Association commentedRerolled patch #9, for 9.5x. please review
Comment #19
pooja saraah CreditAttribution: pooja saraah at Srijan | A Material+ Company for Drupal India Association commentedFixed Failed commands on #18
Attached patch against Drupal 9.5.x
Comment #21
needs-review-queue-bot CreditAttribution: needs-review-queue-bot as a volunteer commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #22
markdorisonUpdated patch to resolve NR bot issue.
Comment #24
sahil.goyal CreditAttribution: sahil.goyal as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedTrying to resolve the errors/warnings for the current version 10.1.x and also attaching the interdiff file.