Sha256: 169f184f587475b82aaba400fe1a219bccb92e9ff4aff212be6ac14070748077

Contents?: true

Size: 522 Bytes

Versions: 1

Compression:

Stored size: 522 Bytes

Contents

class GroupifyMigration < ActiveRecord::Migration
  def change
    create_table :groups do |t|
      t.string     :type
    end

    create_table :group_memberships do |t|
      t.references :member, polymorphic: true, index: true
      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
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
groupify-0.7.0 lib/generators/groupify/active_record/migration/templates/migration.rb