docker-php icon indicating copy to clipboard operation
docker-php copied to clipboard

Feat: option to specify laravel migration connection

Open aagjalpankaj opened this issue 1 year ago • 1 comments

aagjalpankaj avatar Oct 08 '24 09:10 aagjalpankaj

In our organization every Laravel application has two DB connections - application, deploy. application user has DML and deploy user has DDL permissions. Default connection is DB_CONNECTION=application set in .env. While executing migrate command we can specify which connection we want to use. This PR allows us to set the same as environment variable.

@jaydrogers / @danpastori What do you think about this change?

aagjalpankaj avatar Oct 09 '24 09:10 aagjalpankaj

Thanks for proposing this feature!

Unfortunately I had a major refactor on the Laravel Automations script in progress on a different branch, so I was not able to merge this PR.

Good news is we will support this in v4.0 🥳

I expanded on your approach and created a AUTORUN_LARAVEL_MIGRATION_DATABASE variable. You can specify the exact connection from your database config that you'd like to use (ie. mariadb), but I even allow multiple database connections for the 0.1% of people that would ever need to use that 😃 (ie. mariadb,pgsql)

Thanks for proposing this feature ❤️

Test it out here:

  • https://github.com/serversideup/docker-php/pull/283

jaydrogers avatar Oct 07 '25 16:10 jaydrogers