Sha256: 210b2b3a6be7cecaed3bdcea21a6f2b678a0ba294583f5548a53d2a784fd0fd4

Contents?: true

Size: 642 Bytes

Versions: 30

Compression:

Stored size: 642 Bytes

Contents

class CreateG5AuthenticatableRoles < ActiveRecord::Migration
  def change
    create_table(:g5_authenticatable_roles) do |t|
      t.string :name
      t.references :resource, :polymorphic => true

      t.timestamps
    end

    create_table(:g5_authenticatable_users_roles, :id => false) do |t|
      t.references :user
      t.references :role
    end

    add_index(:g5_authenticatable_roles, :name)
    add_index(:g5_authenticatable_roles, [ :name, :resource_type, :resource_id ],
              name: 'index_g5_authenticatable_roles_on_name_and_resource')
    add_index(:g5_authenticatable_users_roles, [ :user_id, :role_id ])
  end
end

Version data entries

30 entries across 15 versions & 1 rubygems

Version Path
g5_authenticatable-0.9.1.pre.2 spec/dummy/db/migrate/20150429212919_create_g5_authenticatable_roles.rb
g5_authenticatable-0.9.1.pre.2 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-0.8.1.pre lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-0.8.1.pre spec/dummy/db/migrate/20150429212919_create_g5_authenticatable_roles.rb
g5_authenticatable-0.8.0 spec/dummy/db/migrate/20150429212919_create_g5_authenticatable_roles.rb
g5_authenticatable-0.8.0 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-0.8.0.beta1 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-0.8.0.beta1 spec/dummy/db/migrate/20150429212919_create_g5_authenticatable_roles.rb
g5_authenticatable-0.7.5 spec/dummy/db/migrate/20150429212919_create_g5_authenticatable_roles.rb
g5_authenticatable-0.7.5 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-0.7.5.beta lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-0.7.5.beta spec/dummy/db/migrate/20150429212919_create_g5_authenticatable_roles.rb
g5_authenticatable-0.7.4 spec/dummy/db/migrate/20150429212919_create_g5_authenticatable_roles.rb
g5_authenticatable-0.7.4 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-0.7.4.beta.1 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-0.7.4.beta.1 spec/dummy/db/migrate/20150429212919_create_g5_authenticatable_roles.rb
g5_authenticatable-0.7.3 spec/dummy/db/migrate/20150429212919_create_g5_authenticatable_roles.rb
g5_authenticatable-0.7.3 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-0.7.2 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-0.7.2 spec/dummy/db/migrate/20150429212919_create_g5_authenticatable_roles.rb