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

Fix install errors when using SQLite. #3980

Closed

Conversation

mortenson
Copy link

While working on making Tome compatible with Drupal Console, I noticed that re-installing with SQLite was quite difficult. If I ran:

drupal site:install standard --force --no-interaction

Re-installs wouldn't work as there was already a database. I saw that there was special logic for deleting the SQLite file, but when I ran:

drupal site:install standard --force --no-interaction --db-type=sqlite --db-file=[...]

It only worked every other execution - I think because the SQLite database is re-created every time a query is made.

To me the most clear behavior would be that drupal site:install standard --force --no-interaction just works for SQLite, and this PR fixes that by:

  1. Setting defaults for options from settings.php when using --no-interaction. Currently if you already have database connection info defined it will use that instead of the --db-* options, but this only happens in interactive mode. Moving the logic block seems like a sane fix.
  2. Move to dropping SQLite tables instead of removing the file. This behavior is more clear and has made re-installs stable for me.

@enzolutions
Copy link
Contributor

Thanks @mortenson for your contribution

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.

2 participants