I'm looking to invoke another migration in a similar fashion to that of generators.
Basically if you have a create table then at some point of time in the future you're no longer using the table and you want a migration to call up
and down
exactly opposite to those of the original create migration.
If it's possible then I'd create a generator something like
rails g reverse_migration CreateModel
and then the result is something like
class ReverseCreateModel < ActiveRecord::Migration
def up
#call to create model down
end
def down
#call to create model up
end
end
I don't want any workaround kind of way and rather explicitly duplicate code and keep the ability for a clean migration and roleback.
Any help would be greatly appreciated!