class GroupifyMigration

Public Instance Methods

change() click to toggle source
# File lib/generators/groupify/active_record/migration/templates/migration.rb, line 2
def change
  create_table :groups do |t|
    t.string     :type

    t.timestamps
  end

  create_table :group_memberships do |t|
    t.references :member, polymorphic: true, index: true, null: false
    t.references :group, polymorphic: true, index: true

    # The named group to which a member belongs (if using)
    t.string     :group_name, index: true

    # The membership type the member belongs with
    t.string     :membership_type

    t.timestamps
  end
end