Stephen
Stephen

Reputation: 187

How to rake db:migrate on a Heroku staging pipeline?

I've setup an app on Heroku, and I've now also set up a pipeline for staging. I did this by creating a fork of my production app on Heroku, then adding this to the app pipeline under the "staging" stage.

Before this (when I only had the app in production), I pushed updates to heroku from the CLI with git push heroku master. I could then update the database for new features with heroku run rake db:migrate.

However, I'm not sure how you would do this with a staging app in a pipeline? I tried using the --remote appendage but it doesn't recognise the app (I think because the --remote was pre pipelines?)

I have auto updates from git setup so that my app-staging always mirrors my git master, and I've just added a new feature which includes a table. The view on the staging site is now returning an error as I haven't run heroku run rake db:migrate on the staging site.

I obviously don't want to push these changes to production without know this new feature works. So how do you do it? Any ideas how to rake db:migrate the pipeline staging database? I can't find any guidance in the heroku manual either :/

Upvotes: 4

Views: 1785

Answers (1)

Tan Nguyen
Tan Nguyen

Reputation: 3376

Run

git remote -v

to see your remote name.

Assuming your staging remote name is staging, then:

heroku run rake db:migrate --remote staging

Read more

Upvotes: 9

Related Questions