# Migration prefix problem

**URL:** <https://www.ruby-forum.com/t/migration-prefix-problem/124262>\
**Category:** Rails\
**Created:** [December 27, 2007, 6:18am UTC](https://www.ruby-forum.com/t/migration-prefix-problem/124262 "2007-12-27T06:18:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![clouder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/0ea827/32.png) [@clouder](https://www.ruby-forum.com/u/clouder)\
**Post date:** [December 27, 2007, 6:18am UTC](https://www.ruby-forum.com/t/migration-prefix-problem/124262/1 "2007-12-27T06:18:32Z")

</div>

I’m using Windows XP SP2, Ruby 1.8.6 patch 111, Rails 1.2.3

When ever I run $ruby script/generate model someModel  
or $ruby script/generate migration someMigration  
I get migration files that are always prefixed with 001 instead of  
incrementing with each new migration creation. Any suggestions would  
be appreciated 😃

---

<div class="post-metadata">

**Author:** ![clouder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/0ea827/32.png) [@clouder](https://www.ruby-forum.com/u/clouder)\
**Post date:** [December 27, 2007, 9:16am UTC](https://www.ruby-forum.com/t/migration-prefix-problem/124262/2 "2007-12-27T09:16:50Z")

</div>

omg, I feel like such an ass. I spent hours digging through the rails  
source printing out variables and hard coding strings, which  
eventually showed me that @mirgation\_directory is relative from where  
you run the generator. Since I has cd’d into myapp/script it was  
looking for db/migrate inside of myapp/script. So to any newbies out  
there who run into this problem stay in your app root directory when  
calling the generate script.
