-
Notifications
You must be signed in to change notification settings - Fork 396
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
Validate DB availability during blt:site:install w/o using drush #2814
Comments
For now I got around this with this:
|
is the issue here that the Docker setup process doesn't create the database (where perhaps the Vagrant / Drupal VM process does) so our checks fail as a result? @japerry did you run into something similar on this with Docksal? |
Your commit here (18aab15) should fix this issue. I can't quite figure out if that commit has been merged into 9.x or 10.x? |
closing due to inactivity |
I'm trying to write some basic on-boarding instructions for developers on my team for a project that uses BLT.
We're using a docker environment. Once the environment is setup, the database server is running, but the default database doesn't exist yet.
I want to instruct users to run the
blt drupal:install
command, which runs the drush site-install command to install the site. Drush is smart enough to automatically create the database if it detects that it doesn't exist, which is great.However, BLT doesn't let drush get that far, because the
internal:drupal:install
command runs thevalidateMySqlAvailable
validation hook. This hook verifies that the MySQL database is available by runningdrush sqlq "SHOW DATABASES"
, which fails because drush is trying to connect to a MySQL database that doesn't yet exist.I'd like to suggest a different method to be used to verify if MySQL is available or not, one that just checks that a connection can be made to the server, but not attempt to connect to the database, since it may not exist yet.
Alternatively, is there a way I can just remove that validation hook? I already provide my own replacement version of
internal:drupal:install
command, but since the hooks are annotations on the original class, I don't think I can remove them.Or maybe I can add a pre-hook that checks if the database doesn't exist, and just create it if not...
The text was updated successfully, but these errors were encountered: