Pedro,

Good catch.  I specified user_id as string in migration and changing
it to integer fixed the problem.  So I guess mysql's more tolerant by
doing a conversion for me?

Thanks a lot!

Zhao

On May 3, 9:21 am, Pedro Belo <[email protected]> wrote:
> It seems like the user_id field is a string.
>
> How did you specify it in your migration?
>
> On Sat, May 2, 2009 at 10:14 PM, zlu <[email protected]> wrote:
>
> > Oren,
>
> > Yes I did a db:migrate and just in case I did one again:
>
> > zlu-macbook:teresa zlu$ heroku rake db:migrate
> > (in /disk1/home/slugs/12955_c9ee63e_1e40/mnt)
>
> > Also if I do a console command I get this:
>
> > zlu-macbook:teresa zlu$ heroku console Status.all
> > [#<Status id: 125061337, type: nil, stat: "801 Gateway Blvd, South San
> > Francisco", longitude: nil, latitude: nil, user_id: "1046706807",
> > created_at: "2009-04-30 19:06:19", updated_at: "2009-04-30 19:06:19">]
>
> > As you can see, the user_id field contains correct data.
>
> > Zhao
>
> > On May 2, 10:05 pm, Oren Teich <[email protected]> wrote:
> >> I've recieved these type of problems after I add a field and forget to
> >> migrate.  Is the heroku DB running your latest?
> >> heroku rake db:mgirate
>
> >> Oren
>
> >> On Sat, May 2, 2009 at 9:34 PM, zlu <[email protected]> wrote:
>
> >> > I have a very simple app, which runs fine locally but fails on heroku.
>
> >> > There are two activerecord tables: users and statuses.  status has a
> >> > user_id column.
>
> >> > If you access this url:
> >> >http://followme.heroku.com/users/
>
> >> > you will get the user_id, then if you access this url:
> >> >http://followme.heroku.com/users/1046706807/statuses
>
> >> > you are supposed to see the statuses of the user (which works locally)
> >> > but instead you'll get an error.
> >> > heroku logs shows the following error:
>
> >> > ActionView::TemplateError (PGError: ERROR:  operator does not exist:
> >> > character varying = integer
> >> > LINE 1: ...T * FROM "statuses"     WHERE ("statuses".user_id =
> >> > 10467068...
> >> >                                                             ^
> >> > HINT:  No operator matches the given name and argument type(s). You
> >> > might need to add explicit type casts.
> >> > : SELECT * FROM "statuses"     WHERE ("statuses".user_id =
> >> > 1046706807) ) on line #1 of statuses/index.html.erb:
> >> > 1: <% @statuses.each do |status| %>
> >> > 2:   <%= status.stat %>
> >> > 3: <% end %>
>
> >> > The code is very simple and I feel it has to be some postgre problem.
>
> >> > Could someone help?
>
> >> > Thanks,
>
> >> > Zhao
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to