insperedia / yiidea-support

Other
2 stars 0 forks source link

Migrations in Docker #2

Closed xstreamka closed 5 months ago

xstreamka commented 5 months ago

In a project that uses Docker, migrations do not work, since the connection is made through an ENV file. Is it possible to somehow make connections between migrations and ENV?

migrations tools: image

config file: app/common/config/main-local.php image

insperedia commented 5 months ago

Thank you for the issue. The plugin runs "php yii migrate" in the background, so there should not be a problem with .env. Are you able to execute migrations by running "php yii migrate" on local machine? Or you execute the "yii migrate" command inside the container

xstreamka commented 5 months ago

Or you execute the "yii migrate" command inside the container

That's right, I'm working with migrations inside a container. Local php does not see ENV and also results in an error.

xstreamka commented 5 months ago

I figured it out, everything works, you just need to register the connection in a local file without variables.