Sha256: 20d48f9444353f39e1070267b311f8a8b50507390fee1359e9deda0415ff118f

Contents?: true

Size: 1.39 KB

Versions: 7

Compression:

Stored size: 1.39 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

7 entries across 7 versions & 1 rubygems

Version Path
cbac-0.6.5 lib/generators/cbac/copy_files/migrate/create_cbac_from_scratch.rb
cbac-0.6.4 lib/generators/cbac/copy_files/migrate/create_cbac_from_scratch.rb
cbac-0.6.2 lib/generators/cbac/copy_files/migrate/create_cbac_from_scratch.rb
cbac-0.5.4 generators/cbac/templates/migrate/create_cbac_from_scratch.rb
cbac-0.5.3 generators/cbac/templates/migrate/create_cbac_from_scratch.rb
cbac-0.5.2 generators/cbac/templates/migrate/create_cbac_from_scratch.rb
cbac-0.5.1 generators/cbac/templates/migrate/create_cbac_from_scratch.rb