Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically Run Database Migrations #661

Closed
dstufft opened this issue Sep 6, 2015 · 1 comment
Closed

Automatically Run Database Migrations #661

dstufft opened this issue Sep 6, 2015 · 1 comment
Labels
requires triaging maintainers need to do initial inspection of issue

Comments

@dstufft
Copy link
Member

dstufft commented Sep 6, 2015

Right now there's no way to automatically run our database migrations, however it would be great if there were (I think?). At the moment whenever there is a migration to apply I have to manually run it. Given that we're on Heroku and we're using pipelines I'm not sure we have very many options to run our migrations. The only idea I can think of is to run them as part of the application starting up, which has problems with the fact we have multiple Dynos running in production.

So I guess the question is, should we run them automatically and if we should, is there anyplace better to run them than on application startup?

@dstufft
Copy link
Member Author

dstufft commented Sep 6, 2015

After talking to @ewdurbin I think the way we're going to go with this, is we'll have auto migrations only when the staging site deploys because that deploys from Github automatically. On top of that, we'll add a wrapper around the heroku pipeline:promote command that won't allow you to trigger a promotion if there is a pending database migration to run.

This will require us to run our migrations remotely, which means we'll need to be careful with how our migrations are handled. We don't want to make any migrations that will remove or alter something that the currently running copy of code will require, nor add anything that the code won't be setup to handle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requires triaging maintainers need to do initial inspection of issue
Projects
None yet
Development

No branches or pull requests

2 participants