Sha256: 68feaa396df0f5b64b03ab91a4c12a675cde9848e9b0bb6c6256b154a91658dd
Contents?: true
Size: 466 Bytes
Versions: 5
Compression:
Stored size: 466 Bytes
Contents
class RolifyCreateRoles < ActiveRecord::Migration[5.1] def change create_table(:roles) do |t| t.string :name t.references :resource, :polymorphic => true 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
5 entries across 5 versions & 1 rubygems