# Rake Bug? db:create:all directs db:migrate to the test db

**URL:** <https://www.ruby-forum.com/t/rake-bug-dball-directs-db-migrate-to-the-test-db/127649>\
**Category:** Rails\
**Created:** [January 31, 2008, 2:37am UTC](https://www.ruby-forum.com/t/rake-bug-dball-directs-db-migrate-to-the-test-db/127649 "2008-01-31T02:37:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![akira](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ba8739/32.png) [@akira](https://www.ruby-forum.com/u/akira)\
**Post date:** [January 31, 2008, 2:37am UTC](https://www.ruby-forum.com/t/rake-bug-dball-directs-db-migrate-to-the-test-db/127649/1 "2008-01-31T02:37:03Z")

</div>

Dear all,

task ‘test’ do  
Rake::Task[‘db:create:all’].invoke  
Rake::Task[‘db:migrate’].invoke  
end

Did I miss something or what? Turns out that this simple task would  
have migration done in the test db.

I’ve tried to “puts RAILS\_ENV” inbetween and it shows “development”,  
but migration’s still done in the test db.

Any ideas?  
Thanks.

ps. However if I break the 2 lines into 2 separate tasks, run them  
individually; then migration’s done in the development db as expected.
