This repository has been archived on 2020-05-27. You can view files and clone it, but cannot push or open issues/pull-requests.
barleysodas/db/migrate/009_create_permissions.rb

21 lines
540 B
Ruby
Raw Normal View History

class CreatePermissions < ActiveRecord::Migration
def self.up
create_table :permissions do |t|
t.column :controller, :string
t.column :action, :string
t.column :http_method, :string
end
create_table :permissions_roles, :id => false do |t|
t.column :permission_id, :integer
t.column :role_id, :integer
end
add_index :permissions_roles, :permission_id
add_index :permissions_roles, :role_id
end
def self.down
drop_table :permissions
drop_table :permissions_roles
end
end