2011-11-24 21:46:19 +00:00
|
|
|
class DropAclTables < ActiveRecord::Migration
|
|
|
|
def self.up
|
|
|
|
drop_table :permissions
|
|
|
|
drop_table :rights
|
|
|
|
drop_table :role_lines
|
|
|
|
drop_table :roles
|
|
|
|
|
|
|
|
remove_column :users, :global_role_id
|
|
|
|
remove_column :groups, :global_role_id
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.down
|
|
|
|
create_table :permissions do |t|
|
|
|
|
t.integer "right_id"
|
|
|
|
t.integer "role_id"
|
|
|
|
t.timestamps
|
|
|
|
end
|
|
|
|
create_table :rights do |t|
|
2014-01-21 04:51:49 +00:00
|
|
|
t.string "name", null: false
|
|
|
|
t.string "controller", null: false
|
|
|
|
t.string "action", null: false
|
2011-11-24 21:46:19 +00:00
|
|
|
t.timestamps
|
|
|
|
end
|
|
|
|
create_table :role_lines do |t|
|
|
|
|
t.integer "role_id"
|
|
|
|
t.integer "relation_id"
|
|
|
|
t.timestamps
|
|
|
|
end
|
|
|
|
create_table :roles do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.text "can_see"
|
2014-01-21 04:51:49 +00:00
|
|
|
t.string "on", default: ""
|
|
|
|
t.string "to", default: ""
|
|
|
|
t.boolean "use_default", default: false
|
|
|
|
t.boolean "use_default_for_owner", default: false
|
2011-11-24 21:46:19 +00:00
|
|
|
t.timestamps
|
|
|
|
end
|
|
|
|
|
|
|
|
add_column :users, :global_role_id, :integer
|
|
|
|
add_column :groups, :global_role_id, :integer
|
|
|
|
end
|
|
|
|
end
|