2009-06-05 14:18:03 +02:00
|
|
|
class CreateRoles < ActiveRecord::Migration
|
2012-07-24 23:26:16 +02:00
|
|
|
def change
|
2009-06-05 14:18:03 +02:00
|
|
|
create_table :roles do |t|
|
|
|
|
t.string :name
|
|
|
|
|
|
|
|
t.timestamps
|
|
|
|
end
|
|
|
|
|
2012-07-24 23:26:16 +02:00
|
|
|
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'
|
2009-06-05 14:18:03 +02:00
|
|
|
end
|
2012-07-24 23:26:16 +02:00
|
|
|
|
2009-06-05 14:18:03 +02:00
|
|
|
end
|