by rheide · 13y ago · 0 comments
Does anyone know an easy way to run the migration on a Heroku Postgres database without pushing the code to a live server?
Where I work, we have a templated Django project that has a fabfile to do this: https://github.com/tangentlabs/tangent-django-boilerplate
If you look in the deploy function (https://github.com/tangentlabs/tangent-django-boilerplate/bl...), you can see the flow is something like:
def deploy():
deploy_codebase()
...
migrate()
...
switch_symlink() heroku pg:credentials DATABASE_URL
And then you can just set it up as the database of a different install. Probably better to deploy the code before migrating though. Use maintenance mode to keep people out while you do.