views:

30

answers:

2

On my server when deploying the app for the first time, I ran rake db:setup which loads my entire migration history from schema.rb. Now I have more stuff I want to add, but when I run rake db:migrate on my server I realize it's trying to run my very first migration, which is failing since the table obviously exists.

Examining the schema_migrations table on my production server, I realize it only has one entry in it, which is the migration that was the most current at the time of the initial deployment. Isn't it supposed to have the entire migration history in it? If so, what caused this? If not, why is it doing this?

+1  A: 

Did you remember to migrate within the production environment?

rake db:migrate RAILS_ENV=production

jdl
A: 

I don't know how this happened, but the problem was indeed the fact that the schema_migrations table only contained the timestamp of the most recent migration as opposed to the full history. I manually inserted all of them and it worked fine.

What scares me is that this somehow happened and I don't know how. Oh well.

ryeguy