- ActiveRecord 6.0+
In your migration declare iherited_from option for create_table method call:
class CreateMembers < ActiveRecord::Migration def change create_table :users do |t| t.string :name end create_table :members, inherited_from: :users do |t| t.string :logo_url end end endAfter migrations members has available both columns.
In your migration call drop_inheritance method. This has no options.
class DropMemberUsersInheritance < ActiveRecord::Migration def change drop_inheritance :members, :users end endIf inheritance exists this will be undeclared, but columns at inherited table will still be available. Otherwise will be raised an exception.