This repository has been archived on 2020-05-27. You can view files and clone it, but cannot push or open issues/pull-requests.
tuxbliki/schema/migrations/006_add_permissions.rb

19 lines
496 B
Ruby

class AddPermissions < ActiveRecord::Migration
def self.up
create_table :permissions do |t|
t.string :name, :limit => 32
end
add_index :permissions, :name
create_table :authors_permissions, :id => false do |t|
t.integer :author_id
t.integer :permission_id
end
add_index :authors_permissions, :author_id
add_index :authors_permissions, :permission_id
end
def self.down
drop_table :permissions
drop_table :authors_permissions
end
end