Sha256: bbd01afb1a90f5a14635d6630b8b3af6b022838e0834ad198681a9e25a255de9

Contents?: true

Size: 833 Bytes

Versions: 1

Compression:

Stored size: 833 Bytes

Contents

class InstallPermissive < ActiveRecord::Migration
  def self.up
    create_table :permissive_permissions do |t|
      t.integer :permitted_object_id
      t.string :permitted_object_type, :limit => 32
      t.integer :scoped_object_id
      t.string :scoped_object_type, :limit => 32
      t.integer :mask, :default => 0
      t.integer :grant_mask, :default => 0
    end
    add_index :permissive_permissions, [:permitted_object_id, :permitted_object_type], :name => 'permissive_permitted'
    add_index :permissive_permissions, [:scoped_object_id, :scoped_object_type], :name => 'permissive_scoped'
    add_index :permissive_permissions, :mask, :name => 'permissive_masks'
    add_index :permissive_permissions, :grant_mask, :name => 'permissive_grant_masks'
  end

  def self.down
    drop_table :permissive_permissions
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
permissive-0.0.1 generators/permissive_migration/templates/permissive_migration.rb