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