class AddRoleIdIndexToRole sUsers ActiveRecord Migration def self up r

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class AddRoleIdIndexToRolesUsers < ActiveRecord::Migration
def self.up
[:role_id, :user_id, [:role_id, :user_id]].each do |idx|
add_index :roles_users, idx
end
end
def self.down
[:role_id, :user_id, [:role_id, :user_id]].each do |idx|
remove_index :roles_users, idx
end
end
end
$ rake db:migrate
(in /home/kron/DEV/pyramid2)
== AddRoleIdIndexToRolesUsers: migrating =====================================
-- add_index(:roles_users, :role_id)
-> 0.1420s
-- add_index(:roles_users, :user_id)
-> 0.2503s
rake aborted!
An error has occurred, all later migrations canceled:
wrong number of arguments (1 for 0)
(See full trace by running task with --trace)