a year ago
Hi, just looking for some input rather that a specific problem. Whats the 'best' way to run (Django) migrations? I use Dockerfile to build.
I use docker-compose locally in development and can run migrations via command when building containers obviously.
I'm not using docker-compose in Railway, but am using a Dockerfile (added project services 'manually' not via compose) to build from.
I could add migrations command to Dockerfile but it would run on ever push/build.
I have, migrated via railway run , from local machine but this only 'works' using the public db address which would cause charges.
Any advice, appreciated as always.
project ID:n/a
22 Replies
a year ago
use it as a pre-deploy command?
a year ago
It will run on every re-deploy, if it has schema/migration changes then it will migrate otherwise it will not.
a year ago
@TheJoker
Yea, i forgot to say, just run it as a start command? But, isn't this the same principal as running via dockerfile?
Railway is basically, automated docker etc
Most of it could be done manually, but just REALLY slowly
a year ago
pre deploy commands are ran in a separated container
a year ago
but yeah, that's basically it
Ah ok @Medim I'll ditch it from the Dockerfile it's building from and add migration to start command.
a year ago
yeah, just read the docs I linked first
a year ago
it's a very short read
a year ago
np
a year ago
!s
Status changed to Solved brody • about 1 year ago