ruby on rails - Capistrano failure when migrating DB changes on deploy -


i have development setup working none of problems describet below.

i deploy production using capistrano , when have new db migrations following error when deploying - these migrations have succeded in development. have db folder linked shared in deploy.rb

any ideas??

debug [a75e33cf]    tasks: top => db:migrate (see full trace running task --trace) (backtrace restricted imported tasks) cap aborted! sshkit::runner::executeerror: exception while executing on host 192.168.2.103: exception while executing on host 192.168.2.103: rake exit status: 1 rake stdout: == 20160204094713 addcolumntocatalog: migrating =============================== -- remove_index("instances", ["catalog_id"], {:name=>"index_instances_on_catalog_id"}) rake aborted! standarderror: error has occurred, , later migrations canceled:  wrong number of arguments (3 1..2)/home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/schema_statements.rb:578:in `remove_index' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:665:in `block in method_missing' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:634:in `block in say_with_time' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:634:in `say_with_time' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:654:in `method_missing' /home/deploy/apps/phototank/releases/20160206231645/db/migrate/20160204094713_add_column_to_catalog.rb:3:in `change' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:608:in `exec_migration' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:592:in `block (2 levels) in migrate' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:591:in `block in migrate' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:590:in `migrate' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:768:in `migrate' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:998:in `block in execute_migration_in_transaction' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:1044:in `block in ddl_transaction' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/transactions.rb:220:in `transaction' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:1044:in `ddl_transaction' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:997:in `execute_migration_in_transaction' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:959:in `block in migrate' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:955:in `each' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:955:in `migrate' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:823:in `up' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:801:in `migrate' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/tasks/database_tasks.rb:137:in `migrate' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>' argumenterror: wrong number of arguments (3 1..2) /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/schema_statements.rb:578:in `remove_index' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:665:in `block in method_missing' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:634:in `block in say_with_time' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:634:in `say_with_time' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:654:in `method_missing' /home/deploy/apps/phototank/releases/20160206231645/db/migrate/20160204094713_add_column_to_catalog.rb:3:in `change' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:608:in `exec_migration' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:592:in `block (2 levels) in migrate' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:591:in `block in migrate' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:590:in `migrate' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:768:in `migrate' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:998:in `block in execute_migration_in_transaction' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:1044:in `block in ddl_transaction' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/transactions.rb:220:in `transaction' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:1044:in `ddl_transaction' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:997:in `execute_migration_in_transaction' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:959:in `block in migrate' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:955:in `each' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:955:in `migrate' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:823:in `up' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:801:in `migrate' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/tasks/database_tasks.rb:137:in `migrate' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>' tasks: top => db:migrate (see full trace running task --trace) rake stderr: nothing written  sshkit::runner::executeerror: exception while executing on host 192.168.2.103: rake exit status: 1 rake stdout: == 20160204094713 addcolumntocatalog: migrating =============================== -- remove_index("instances", ["catalog_id"], {:name=>"index_instances_on_catalog_id"}) rake aborted! standarderror: error has occurred, , later migrations canceled:  wrong number of arguments (3 1..2)/home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/schema_statements.rb:578:in `remove_index' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:665:in `block in method_missing' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:634:in `block in say_with_time' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:634:in `say_with_time' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:654:in `method_missing' /home/deploy/apps/phototank/releases/20160206231645/db/migrate/20160204094713_add_column_to_catalog.rb:3:in `change' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:608:in `exec_migration' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:592:in `block (2 levels) in migrate' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:591:in `block in migrate' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:590:in `migrate' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:768:in `migrate' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:998:in `block in execute_migration_in_transaction' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/migration.rb:1044:in `block in ddl_transaction' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction' /home/deploy/apps/phototank/shared/bundle/ruby/2.2.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction' 

the syntax in migration wrong. remove_index method takes 1 standard parameter , named parameters. migration in question has 2 standard parameters , 1 named parameter.

http://apidock.com/rails/activerecord/connectionadapters/schemastatements/remove_index

remove_index("instances", ["catalog_id"], {:name=>"index_instances_on_catalog_id"}) 

should be

remove_index("instances", column: 'catalog_id', name: 'index_instances_on_catalog_id') 

this untested code, verify ahead of time. can grab copy of production database , run rake db:migrate locally test , debug.


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -