Considering 4 models (very simplified)
class Group1 << AR::Base
has_many group1_items
end
class Group2 << AR::Base
has_many group2_items
end
class GroupItem << AR::Base
belongs_to :group1
belongs_to :thing
end
class Group2Item << AR::Base
belongs_to :group2
belongs_to :thing
end
I want to "merge" Group2 and Group2Items to Group1 and Group1Items. Group2 will inherit from Group1. What I want :
class Group2 << Group1
Group2Item model will be inused.
I need to create a migration to 'move' Group2 and Group2Items data to Group1 and Group1Item tables.
My migration must be accessible whatever the application state, i.e. the Group2 and Group2Item tables can not be present, so I need to do this juste in mySQL syntax.
Is there a simple way to do this ?