Sha256: dd61b94d6be6659e4169256feb7d40537f3a47dbce0857c2e2bf6751c8136f2b

Contents?: true

Size: 1.45 KB

Versions: 3

Compression:

Stored size: 1.45 KB

Contents

class CreateCbacFromScratch < ActiveRecord::Migration
  def self.up
    create_table :cbac_permissions do |t|
      t.integer :generic_role_id, :default => 0
      t.string :context_role
      t.integer :privilege_set_id
      t.timestamps
    end

    create_table :cbac_generic_roles do |t|
      t.string :name
      t.text :remarks
      t.timestamps
    end

    create_table :cbac_memberships do |t|
      t.integer :user_id
      t.integer :generic_role_id
      t.timestamps
    end

    create_table :cbac_privilege_set do |t|
      t.string :name
      t.string :comment
      t.timestamps
    end

    create_table :cbac_staged_permissions do |t|
      t.integer :pristine_role_id
      t.string :privilege_set_name
      t.integer :line_number
      t.string :comment
      t.text :operation, :limit => 2
      t.timestamps
    end

    create_table :cbac_staged_roles do |t|
      t.string :role_type
      t.string :name
      t.integer :role_id
      t.timestamps
    end

    create_table :cbac_known_permissions do |t|
      t.integer :permission_number, :null => :no
      t.integer :permission_type, :default => 0
    end
  end

  def self.down
    drop_table :cbac_permissions
    drop_table :cbac_generic_roles
    drop_table :cbac_memberships
    drop_table :cbac_privilege_set
    drop_table :cbac_staged_permissions
    drop_table :cbac_staged_roles
    drop_table :cbac_known_permission
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cbac-0.6.3 lib/generators/cbac/copy_files/migrate/create_cbac_from_scratch.rb
cbac-0.6.1 lib/generators/cbac/copy_files/migrate/create_cbac_from_scratch.rb
cbac-0.6.0 lib/generators/cbac/copy_files/migrate/create_cbac_from_scratch.rb