photomix/db/migrate/20090604202930_create_roles.rb
Alexander Negoda e59d11e1c9 big update
2012-07-25 01:26:16 +04:00

18 lines
430 B
Ruby

class CreateRoles < ActiveRecord::Migration
def change
create_table :roles do |t|
t.string :name
t.timestamps
end
create_table :roles_users, :id => false, :force => true do |t|
t.references :role
t.references :user
end
add_index :roles_users, :role_id, :name => 'index_roles_users_on_role_id'
add_index :roles_users, :user_id, :name => 'index_roles_users_on_user_id'
end
end