Is there a way to tell db:migrate to continue if it encounters an
exception? Sometimes during developing, the migration files aren’t
always exactly the way I want them (surprisingly;-).
For example:
001_add_table1.rb:
class AddTable1 < ActiveRecord::Migration
def self.up
create_table “table1”, :force => true do |t|
t.column :string1, :string, :limit => 40, :null => false
end
end
def self.down
drop_table :table1
end
end
002_add_column.rb:
class AddColumn < ActiveRecord::Migration
def self.up
add_column :table1, :text1, :text, :null => false
end
def self.down
remove_column :table1, :text1
end
end
Somewhere along the line I may end up deleting table ‘table1’ from the
database inadvertently. So, if I run db:migrate, it’s quite likely to
choke when applying version 2 (002_add_column.rb) or attempting a
rollback to version 1.
But during development, I want it to keep going. Is there a way to do
that?
Thanks,
Stan