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

[database:restore] #2174 Recreate database before importing the dump #3856

Closed

Conversation

marcelovani
Copy link
Member

This PR fixes the issue #2174
I don't think we need a --replace option. The DROP/CREATE needs to happen every time.

@marcelovani
Copy link
Member Author

This should also help #3097

@@ -36,8 +36,3 @@ services:
arguments: ['@database', '@date.formatter', '@entity_type.manager', '@string_translation']
tags:
- { name: drupal.command }
Copy link
Member Author

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') {
Copy link
Member Author

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.

@enzolutions
Copy link
Contributor

Thanks @marcelovani for your contribution, due to some conflicts @harold20 took it and reship in other PR #4037

enzolutions pushed a commit that referenced this pull request May 15, 2019
* #2174 Make command available without a site installed

* #2174 Recreate database before importing the dump

* Fixing tabs
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.

3 participants