user984621
user984621

Reputation: 48513

Heroku - how to remove table and run migration again?

I just discovered that one of my tables in Heroku app has a different structure than the one on my localhost.

In the best way I would need to run the migration that create a new table again, but what is the best way to do that?

Just simply manually remove the table in Heroku terminal and then change the date of migration and run it again?

Upvotes: 4

Views: 688

Answers (1)

tmaximini
tmaximini

Reputation: 8503

you can redo a single migration file like this:

heroku run rake db:migrate:redo VERSION=20130311054546

where 20130311054546 is the timestamp of your migration.

To do different database modifications, such as drop table etc., I usually use David Dollar's heroku SQL console

Upvotes: 1

Related Questions