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.22 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1.21 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1.20 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1.19 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1.18 testing-with-2.1.18/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1.18 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1.17 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1.16 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1.15 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1.14 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1.13 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1.12 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1.11 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1.10 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1.9 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1.8 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1.7 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1.6 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1.5 installer/core/db/migrate/20140812210925_rolify_create_roles.rb
keppler-2.1.4 installer/core/db/migrate/20140812210925_rolify_create_roles.rb