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
Platform integration: Download all databases, Allow a primary relationship for the main 'db', fixes #4415, fixes platformsh/ddev-platformsh#59 #4426
Conversation
Download the artifacts for this pull request: |
I can verify that this works nicely. I tried it with the Thanks |
Thanks @bserem - I think I may try to just get it to pull all databases. |
5a80864
to
1e1eefa
Compare
@bserem @gilzow @lolautruche this should be ready for your review. Much more mature regarding databases and |
I don't know if these are "issues" or not and whether they are ddev issues or add-on issues, but here's what I observed using this version of ddev when adding in the platformsh-ddev addon
After
|
Thanks for testing @gilzow !
Could you please test without the add-on, since the add-on isn't compatible with multiple db relationships? You can just clone your project into a different directory, and use |
Thanks @rfay! Here's my test-run and some thoughts. Platform.sh ConfigFor reference, this how DBs are under PSH. This is used for both tests below.
Test run 1
Output:
Test run 2
Output
Thoughts
I hope I expressed my thoughts clearly :) Like #4417, my time regarding ddev+platformsh is sponsored by Annertech |
@bserem there isn't any way that DDEV will be able to support multiple databases of different types. I used this template, https://github.com/platformsh-templates/drupal9-multisite |
Co-authored-by: Bill Seremetis <bill@seremetis.net>
I'd be interested in votes on whether this should go in as is. I'm pretty sure the only risk is to platform.sh users doing multiple databases, which they can't do right now, and they or we can improve the platform.yaml as we go. However, it could wait and not go into this release, although there's a bugfix in there that does need to go in. |
Some responses to your questions @bserem
Also note that platformsh/ddev-platformsh cannot currently work against multiple-database projects at all, unrelated to this PR. Thanks so much for the great and detailed feedback. |
@gilzow I just finally "processed" your statement "Exited ssh, and then ran ddev pull platform. I only have a single database. DB pull worked just fine, but DDEV errored out during the files pull portion with Would you be able to share that project with me? |
I'm going to go for it and pull this; I don't believe it will affect folks with a single database, and will do significant testing of this feature in the release testing process. Conversation and responses here and additional issues are all very welcome. |
Good news on this becoming part of DDEV. It'll help a lot :) Now, regarding My relationships are:
That's why |
If you |
@@ -42,6 +42,20 @@ web_environment: | |||
4. Run `ddev pull platform`. After you agree to the prompt, the current upstream database and files will be downloaded. | |||
5. Optionally use `ddev push platform` to push local files and database to Platform.sh. The [`ddev push`](../basics/commands.md#push) command can potentially damage your production site, so we don’t recommend using it. | |||
|
|||
If you have more than one database on your Platform.sh project, you'll need to choose which one you want to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rfay I understand only one database will be handled by the integration, but what would you recommend if I had additional databases I also wanted to pull into DDEV?
Create my own modified version of platform.yaml
and modify db_pull_command
?
I ask because I’m looking at the docs, and designating a primary naturally begs the question of what I should do with my other ones. Even if it’s just a hint, it seems like it’d be worth addressing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this version, all databases will be handled by the ddev pull platform
, so line 45 is just incorrect. Thanks for catching that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I understanding correctly that all databases will be pulled, but that I still need to designate a PLATFORM_PRIMARY_RELATIONSHIP
so DDEV knows what to use for its (default) 'db'
database?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ultimately asking while I attempt to improve the wording over here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattstein this is correct.
- All databases will be downloaded
- The remote database that is flagged as primary will be imported into the
db
database of DDEV (the default one) - All other remote databases will be imported into ddev databases with the same as in the remote
I believe I've never used the word database that much in such a short message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bserem Thanks for clarifying the database behavior for this database-related documentation adjustment regarding databases. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all projects will need for a "db" database to be populated. For example, as the ddev-platformsh add-on matures, it should be able to handle databases of any number that have the same names they do on Platform.sh, and the "db" database not be used at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is more of an if you have multiple databases and want to designate a primary to use with 'db'
, yes? If so I’ll update #4469 accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is correct. Most people who have ever used DDEV will want that. There may be contexts in the future where that's not needed. The same may be true for Acquia or Pantheon or other hosts, where the settings are wired to particular database names and people are not using DDEV's automatically generated settings, like settings.ddev.php
or Craft CMS's .env configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revised in this commit, which is hopefully more accurate! 😅
Based on ddev#4426 (comment).
The Problem/Issue/Bug:
How this PR Solves The Problem:
This also fixes a bug in handling blank
--environment
inddev pull
Manual Testing Instructions:
Try it out on a multisite or whatever,
ddev config --web-environment-add=PLATFORM_PRIMARY_RELATIONSHIP=maindb
orddev pull platform --environment=PLATFORM_PRIMARY_RELATIONSHIP=maindb
Automated Testing Overview:
Multiple databases are not yet covered in TestPlatformPull.
Related Issue Link(s):
Release/Deployment notes: