Forum: Ruby-Forum.com Getting an error on adding migration

45a7599d67c3819a0023f0f5f15d77ca?d=identicon&s=25 Sam John (sumin)
on 2008-10-24 12:37
Hello ,

  I am a ROR beginner. I did scaffolding and made a table called
register with a field "name". Now when I tried to add one more column
using add migration and then rake db:migrate, the command is executing
successfully but new columns are not coming in the table

 Sam
C19de50a99c0b4d7671bb85ce49b08d3?d=identicon&s=25 Sara Criss (sara_criss)
on 2008-10-28 15:25
Sam John wrote:
> Hello ,
>
>   I am a ROR beginner. I did scaffolding and made a table called
> register with a field "name". Now when I tried to add one more column
> using add migration and then rake db:migrate, the command is executing
> successfully but new columns are not coming in the table
>
>  Sam

can u plz brief a lil bit more than i am able to understand ...that y ur
columns are not coming in the table
45a7599d67c3819a0023f0f5f15d77ca?d=identicon&s=25 Sam John (sumin)
on 2008-10-29 07:18
Sara Criss wrote:
> Sam John wrote:
>> Hello ,
>>
>>   I am a ROR beginner. I did scaffolding and made a table called
>> register with a field "name". Now when I tried to add one more column
>> using add migration and then rake db:migrate, the command is executing
>> successfully but new columns are not coming in the table
>>
>>  Sam
>
> can u plz brief a lil bit more than i am able to understand ...that y ur
> columns are not coming in the table


  Thank you for the reply :-) . I will explain . I did scaffolding and
made a table called register with a field "name" . After that as I
wanted to add more fields in that table I did the add migration command
which is "ruby script/generate migration AddPasswordToRegister
password:varchar" and also the rake db:migrate command. But when I run
it on the browser the new column (password) which has been added is not
showing there. it is only showing the "name" field which i got when i
did scaffolding. I am able to add many columns through migration but
they are not displaying on the browser. When I checked the files in my
system , I could find out that new migration files are being created in
the db/migration folder but nothing is being created in the views.

 hope this would help you to understand my problem now

 Sam
D21058138cd06ffa74c9a386c358feab?d=identicon&s=25 Ratnavel P S (ratnavel)
on 2008-11-05 06:19
Sam Migration is to database and Scaffold is for view purpose.

On running migration a column may be added to yr DB. Check that first if
there is a column the work of migration is that and its done.

Scaffold is responsible to generate CRUD skeleton code. Since you did
scaffold before adding the new field password thats not reflected.

Cheers,
Ratnvael.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.