-
Notifications
You must be signed in to change notification settings - Fork 149
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
No database selected when backup dynamic database #78
Comments
@martiendt firstly which multi-tenancy package are you using ? I see that you are setting the dynamic connections config which is correct , But u cannot use artisan cli while running the backup since artisan runs a different instance (i think as per my understanding). What I suggest is try to run the backup using Manager instance. if you are running this in any controller inject the Manager into the __construct & Don't forget to type hint the Manager and Destination Facades.
This is what i would have done. |
Yea, I wouldn't in general call an artisan command using If you inject the manager you should have no problems. |
Same issue. Used the code above (tweaked for my multi-tenancy code) but still not working. Can't set the database during runtime. |
Is there any solution to this issue? I am having the same problem with my multi-tenancy app. |
I'm open to solutions. Got anything in mind? The stand-alone "driver" has details necessary for using it in any circumstance. The library is infinitely extendable so new procedures and tasks can be created as well. Let me know if you have thoughts. |
This may not be the best solution, but I got this to work. I've created an environment variable in the database config to specify the database name.
Then in the place where I switch the database, I check if the app is running in console and write the name of the database to the
Here is the function to write to the
This hasn't been fully tested or the best solution but works. |
Hello, i tried to backup my database dynamically but i got error no database selected, this is my code, i run this via console command
Error message
NOTE :
$client->db_name
is existsArtisan::call('db_backup')
it's not see my setup abovei'm using Backup Manager v1.1.2 and Laravel 5.1
The text was updated successfully, but these errors were encountered: