Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve import-db/export-db with --target-db and --no-drop flags, fixes #1961, fixes #1652 #2037

Merged
merged 15 commits into from Jan 28, 2020

Conversation

rfay
Copy link
Member

@rfay rfay commented Jan 21, 2020

The Problem/Issue/Bug:

#1961 requested the ability (later the default) of dropping tables
#1652 requested an additional flag to target a secondary database

How this PR Solves The Problem:

  • Goes back to import-db dropping all tables as the default
  • Adds --no-drop flag for when that's not what's wanted
  • Adds --target-db to target another database (and create it if necessary)
  • Minor docs added to the FAQ section about working with additional databases
  • Adds optional "project" arg to both import-db and export-db
  • Adds --target-db also to ddev export-db

Manual Testing Instructions:

ddev export-db <project> >someproject.sql.gz
ddev import-db <someproject.sql.gz
ddev import-db --target-db newdb --src someproject.zql.gz, verify contents of "newdb"
ddev import-db another smaller one. Only the new tables should still exist.
ddev import-db a normal db
ddev import-db --no-drop a smaller one with different tables. The union of the tables should now exist.
ddev import-db --target-db=somedb and verify that "somedb" now exists and has contents of the import.

Automated Testing Overview:

  • TestDdevImportDB was expanded to cover this territory
  • TestCmdImportDB was expanded to handle import from named project
  • TestCmdExportDB was added with basic test of ddev export-db
  • TestDdevExportDB expanded

Related Issue Link(s):

#1961
#1652

Release/Deployment notes:

@rfay rfay changed the title Improve import-db with --target-db and --no-drop flags Improve import-db with --target-db and --no-drop flags, fixes #1961, fixes #1652 Jan 24, 2020
@rfay rfay changed the title Improve import-db with --target-db and --no-drop flags, fixes #1961, fixes #1652 Improve import-db/export-db with --target-db and --no-drop flags, fixes #1961, fixes #1652 Jan 25, 2020
@rfay rfay merged commit 08720f9 into ddev:master Jan 28, 2020
@rfay rfay deleted the 20200120_import_db_target branch January 28, 2020 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant