Answer the question
In order to leave comments, you need to log in
How to delete a table if rollback fails?
Rollback does not work, I thought it would work if I divided the migration, but alas.
Answer the question
In order to leave comments, you need to log in
If necessary, through migration, create an empty migration DeleteComments and write in it drop_table :comments
Then run the migration.
Here is the details api.rubyonrails.org/classes/ActiveRecord/Migration.html
Or you can without migration, start the rails console and typeActiveRecord::Migration.drop_table(:comments)
Create "correct" migrations with up and down methods, you can read more details here: selectedproblems.blogspot.com/2011/09/rails-migrat...
If you had a "correct" migration, you could write rake db to rollback :rollback
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question