ZirconCode
ZirconCode

Reputation: 817

Rails Migration and Schema (generate/destroy)

I'm playing around with rails migrations and I've ran into a problem which I haven't been able to find a solution to.

Basically, I use the rails generators to create and destroy migrations to add and remove variables in models.

As a result of using 'rails destroy migration', my schema is all messed up. It doesn't reflect my present migrations at all. Is this a limitation of the destroy mechanism, or have I missed some crucial rake db: commands? Is there a way to reconstruct the schema from the current migrations?

I'm having trouble putting the pieces together, a link or keywords would suffice.

Upvotes: 0

Views: 849

Answers (1)

Thaha kp
Thaha kp

Reputation: 3709

Rollback your migrations,

rake db:rollback to rollback to the last migration.

rake db:rollback STEP=3 will revert the last 3 migrations.

More about rake tasks here

Upvotes: 1

Related Questions