You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But how am I supposed to run the migration in an existing running server ?
I CANNOT RUN npx vendure migrate and select "Run pending migrations" because this will run inside Github Actions and how am I suppose to select the option ?
Assuming the migration file looks correct, the next time you start the server,
the migration will be run automatically. This is because the runMigrations
function is called in the src/index.ts file:
Migration should run automatically when you start the server, unless I misunderstood your issue ?
Automatically updating the DB schema when server is started is a Anti-DevOps principle. We should be able to control when and how we run the migrations. And for that npx vendure migrate command is good, but it is interactive, which cannot(or hard to achieve) in a Github Actions CI/CD pipeline.
A better option is to send in arguments like --no-interaction combined with --runMigration or other arguments like that
Nevertheless, I found a way to run the migration separately.
And to anyone coming here, at the time of writing, copy the
Describe the bug
Following the docs: https://docs.vendure.io/guides/developer-guide/migrations/ I can create a migration in local.
But how am I supposed to run the migration in an existing running server ?
I CANNOT RUN
npx vendure migrate and select "Run pending migrations"
because this will run inside Github Actions and how am I suppose to select the option ?To Reproduce
Steps to reproduce the behavior:
npx vendure migrate
option in Github ActionsExpected behavior
A simple way is to allow sending in arguments like
--run
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: