Sha256: faebf08db04315d4dad13e675367fd9f537a0ebe95c1914d833787fe83f2ddfe

Contents?: true

Size: 486 Bytes

Versions: 1

Compression:

Stored size: 486 Bytes

Contents

class UserInstitutions < ActiveRecord::Migration
  def up
    create_table :institutions do |t|
      t.string :name
      t.string :pid
    end
    create_table :institutions_users, :id => false do |t|
      t.references :institution
      t.references :user
    end
    add_index :institutions_users, [:institution_id, :user_id]
    add_index :institutions_users, [:user_id, :institution_id]
  end

  def down
    drop_table :institutions_users
    drop_table :institutions
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bpl-institution-management-0.0.2 lib/generators/institutions/templates/migrations/user_institutions.rb