user1735921
user1735921

Reputation: 1389

Rails Migration Rollback: How to delete generated migration

I generated a new migration using command,

rails g migration add_stdf_to_sds blahblah:string

I have not used rake:db migrate till now and I don't want to use it because I don't want this migration to happen, how can I delete my generated migration?

I know about rollback, but I haven't used db:migrate till now so it won't work. (I guess).

Upvotes: 0

Views: 167

Answers (2)

madcow
madcow

Reputation: 2633

rails d migration add_stdf_to_sds

In general 'rails d' which stands for 'rails destroy' is a great way to undo any command that a generator has performed.

Upvotes: 1

bassemreda
bassemreda

Reputation: 11

rails g migration adds a file in db/migrations that starts with a timestamp. Delete that file from the filesystem.

Upvotes: 1

Related Questions