rake db:test:clone_structure
을 실행하려고했지만 데이터베이스를 다시 작성하지 못했습니다. 내가 에 clone_structure
작업을 변경할 때, 이제레이크 종속성이 실행되지 않고 작동합니다.
$ rake db:test:clone_structure --trace
** Invoke db:test:clone_structure (first_time)
** Invoke db:structure:dump (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:structure:dump
** Invoke db:test:purge (first_time)
** Invoke environment
** Execute db:test:purge
** Execute db:test:clone_structure
: 내가 추적을 실행하면, 내가 db:test:load_structure
실행하기되지 않은 것으로 나타났습니다
task :clone_structure => [ "db:structure:dump", "db:test:load_structure" ]
: 드디어 작업 자체 보았다 모든 것이 갑자기 작동 ... ...load_structure
호출
task :clone_structure => [ "db:structure:dump", "db:test:load_structure" ] do
db_namespace["test:load_structure"].invoke
end
!
$ rake db:test:prepare --trace
** Invoke db:test:clone_structure (first_time)
** Invoke db:structure:dump (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:structure:dump
** Invoke db:test:purge (first_time)
** Invoke environment
** Execute db:test:purge
** Execute db:test:clone_structure
** Invoke db:test:load_structure (first_time)
** Invoke db:test:purge
** Execute db:test:load_structure
** Invoke db:structure:load (first_time)
** Invoke environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:structure:load
이 동작을 일으키는 원인은 무엇입니까? 저는 Rails 3.2.14와 Rake 10.1.0을 사용하고 있습니다.
업데이트 : 나는 3.2.11에서 3.2.13으로 레일을 업그레이드했으며 여전히 문제가 있습니다.
두 번째 업데이트 : 내가 3.2.14에 레일을 업그레이드 10.1.0 레이크하고 난 당신이 거의가 말을 여전히 문제
'rake db : test : clone_structure'를 실행할 때 structure.sql이 문제없이 생성됩니까? 그걸로 어떤 문제가 보이나요? –
'RAILS_ENV = test rake db : test : prepare --trace'를 실행할 수 있습니까? 가끔은'RAILS_ENV'가 특정 작업을 실행하도록 설정되어야한다는 것을 보았습니다. – Subhas
@yuri : db : test : clone_structure가 완벽하게 작동하는 것처럼 보입니다. 나는 확실히하기 위해 몇 가지 디버그를 던질 것이다. – abeger