Sha256: 44ecf30ed15c4a4cb6968b0c37628e90758e9bad166af8681469cb42f1416423

Contents?: true

Size: 516 Bytes

Versions: 32

Compression:

Stored size: 516 Bytes

Contents

class RolifyCreateRoles < ActiveRecord::Migration[5.1]
  def change
    create_table(:roles) do |t|
      t.string :name
      t.integer :position
      t.references :resource, polymorphic: true

      t.string :deleted_at
      t.timestamps
    end

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

    add_index(:roles, :name)
    add_index(:roles, [ :name, :resource_type, :resource_id ])
    add_index(:users_roles, [ :user_id, :role_id ])
  end
end

Version data entries

32 entries across 31 versions & 1 rubygems

Version Path
keppler-2.1.3 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1.2 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1.1 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1.pre.p1 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.0.7 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.0.6 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.0.5 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.0.4.p1 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.0.4.pre.p1 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.0.4 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.0.3 installer/core/db/migrate/20140812210925_rolify_create_roles.rb