Sha256: 388f608ff0dbafda41fbc5aff22b38d132145c011dd28f893b9fd472679e3cab

Contents?: true

Size: 697 Bytes

Versions: 18

Compression:

Stored size: 697 Bytes

Contents

# frozen_string_literal: true

class CreateG5AuthenticatableRoles < ActiveRecord::Migration<%= migration_version %>
  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

18 entries across 18 versions & 1 rubygems

Version Path
g5_authenticatable-1.1.4 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-1.1.4.rc.3 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-1.1.4.rc.2 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-1.1.4.rc.1 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-1.1.2 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-1.1.2.pre.1 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-1.1.2.rc.5 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-1.1.2.rc.4 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-1.1.2.rc.3 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-1.1.2.rc.2 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-1.1.2.rc.1 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-1.1.1 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-1.1.0 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-1.0.0 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-1.0.0.pre.4 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-1.0.0.pre.3 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-1.0.0.pre.2 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
g5_authenticatable-1.0.0.pre.1 lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb