-
Notifications
You must be signed in to change notification settings - Fork 146
Move extra params definition to backup manager config #119
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
Move extra params definition to backup manager config #119
Conversation
This will break functionality for those who require this argument, the PR needs to allow arguments to be passed from a config file instead of hardcoded |
Noted @robbielove, I will try to make it optional via the config file. |
If it helps, I believe the parent package seems to handle this with the ability to pass these parameters, you might find this useful: backup-manager/backup-manager#138 |
@robbielove, I moved the About your references here, backup-manager/backup-manager#138, I have tried to change the extraParams key and value on this config file:
But I don't see the change was affected in Laravel project. So as far as I try, only the |
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.
I have reviewed these changes and realised that this is better suited to an environment variable as the requirement to fill extraParams is based on whether mysql needs --column-statistics=0 or not (e.g. this is required for maria db and maybe mysql 8?) therefore this will be based purely on the enviroment where the app is running.
I propose that you change src/GetDatabaseConfig.php to:
Line 41 'extraParams' => env('DB_PARAMS'),
and remove your changes to config/backup-manager.php
Sorry for suggesting this needs to go in a config file earlier. I have tested your code and also my changes and found both work.
I would also suggest making a note of this in the README.md to suggest that DB_PARAMS="--column-statistics=0"
can be added to the .env file for environments that require it. (remembering this can be used for other parameters that I have not explored; like '--max-allowed-packet'
)
@robbielove, I do agree to have this on env variable, since our env on local, staging and production might be different. But we still need to have it in config. Because, if we use Docs reference: https://laravel.com/docs/6.x/configuration#configuration-caching Wdyt @robbielove? |
I agree with that |
Thanks a lot for your review @robbielove, we will wait for repo maintainer's review to see if it fit their need. |
This PR will be a fix for reported error after laravel 6 support. #118 (comment)
This fix works for laravel 6 on MySQL 5.7 or MariaDB 10.2.
Kindly please review this @ShawnMcCool, @mitchellvanw.