# Problems while creating a new migration file

**URL:** <https://www.ruby-forum.com/t/problems-while-creating-a-new-migration-file/196849>\
**Category:** Ruby\
**Created:** [November 26, 2008, 10:45am UTC](https://www.ruby-forum.com/t/problems-while-creating-a-new-migration-file/196849 "2008-11-26T10:45:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![indu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/eada6e/32.png) [@indu](https://www.ruby-forum.com/u/indu)\
**Post date:** [November 26, 2008, 10:45am UTC](https://www.ruby-forum.com/t/problems-while-creating-a-new-migration-file/196849/1 "2008-11-26T10:45:31Z")

</div>

Hello ,

I am a ROR beginner. I have a controller named “users” and the  
corresponding view,model created using the command “ruby script/generate  
scaffold user name:string”.By running the command rake db:migrate will  
create the table “users” with a field “name” and the migration file  
created automatically is “001\_create\_users.rb”. Now when I tried to add  
one more column “password”  
by creating a new migration file using the command “ruby script/generate  
migration create\_users” and made the appropriate changes like  
“add\_column :users,:password,:string” in that file, an error is occuring  
like “Another file named 001\_create\_users.rb already exists”. May any  
one let me know what is the problem? I am using the right way or not?

Thanks in advance  
Indu

---

<div class="post-metadata">

**Author:** ![indu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/eada6e/32.png) [@indu](https://www.ruby-forum.com/u/indu)\
**Post date:** [November 26, 2008, 12:48pm UTC](https://www.ruby-forum.com/t/problems-while-creating-a-new-migration-file/196849/2 "2008-11-26T12:48:02Z")

</div>

Indu RS wrote:

> I am a ROR beginner.

Welcome, but I’m afraid you’re on the wrong list. Please post your  
question to a Rails mailing list or forum.

Whilst there are some Rails users here, this mailing list is primarily  
for discussion of the Ruby Language (which Rails just happens to be  
written in).

Regards,

Brian.

---

<div class="post-metadata">

**Author:** ![indu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/eada6e/32.png) [@indu](https://www.ruby-forum.com/u/indu)\
**Post date:** [November 27, 2008, 8:20pm UTC](https://www.ruby-forum.com/t/problems-while-creating-a-new-migration-file/196849/3 "2008-11-27T20:20:51Z")

</div>

Indu RS wrote:

> by creating a new migration file using the command “ruby script/generate  
> migration create\_users” and made the appropriate changes like  
> “add\_column :users,:password,:string” in that file, an error is occuring  
> like “Another file named 001\_create\_users.rb already exists”.

Try to name your migration after what it is doing, e.g:  
./script/generate migration AddPasswordToUserModel

Don’t know why you get the error you do, but naming migrations more  
uniquely should at least avoid it 🙂

H!
