-
-
Notifications
You must be signed in to change notification settings - Fork 557
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
[database:restore] #2174 Recreate database before importing the dump #3856
[database:restore] #2174 Recreate database before importing the dump #3856
Conversation
This should also help #3097 |
@@ -36,8 +36,3 @@ services: | |||
arguments: ['@database', '@date.formatter', '@entity_type.manager', '@string_translation'] | |||
tags: | |||
- { name: drupal.command } |
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.
Moving the code to uninstall.services.yml to make it available before we have a site running
if (strpos($file, '.sql.gz') !== false) { | ||
$catCommand = "gunzip -c %s | "; | ||
} else { | ||
$catCommand = "cat %s | "; | ||
} | ||
|
||
$commands = array(); | ||
if ($databaseConnection['driver'] == 'mysql') { |
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.
Drop (if exists) and Create database. This is necessary when installing the site from a dump.
Thanks @marcelovani for your contribution, due to some conflicts @harold20 took it and reship in other PR #4037 |
This PR fixes the issue #2174
I don't think we need a --replace option. The DROP/CREATE needs to happen every time.