Sha256: 7d291cfffcf149ea4781d794c39648811461e087230b045ac510fbb1c767a826

Contents?: true

Size: 731 Bytes

Versions: 3

Compression:

Stored size: 731 Bytes

Contents

class RightOnMigration < ActiveRecord::Migration
  def self.change
    create_table :rights do |t|
      t.string :name, :controller, :action, :limit => 150
      t.timestamps
    end

    change_table :rights do |t|
      t.index :action
      t.index :name
      t.index [:controller, :action]
    end

    create_table :rights_roles, :id => false do |t|
      t.integer :right_id, :role_id
    end

    change_table :rights_roles do |t|
      t.index [:right_id, :role_id]
      t.index [:role_id, :right_id]
    end

    create_table :roles do |t|
      t.string  :title
      t.text    :description
      t.integer :right_id
      t.timestamps
    end

    change_table :roles do |t|
      t.index :right_id
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
right_on-0.3.0 db/migration.rb
right_on-0.2.0 db/migration.rb
right_on-0.1.0 db/migration.rb