Hi, there. I have an application running with sqlite in development mode and production mode. I just installed mysql on windows and created a new database in mysql for the application in development mode. After putting some data in database, I found that I can''t save Time object like ''Tue Feb 01 12:34:56 UTC 2000" completely. Mysql showed the time only "12:34:26". But sqlite is able to save it and convert it to something like "2010-02-01 12:34:56". I had to convert the Time object before I saved it to database. The other problem I encountered is storing long string in mysql. I put some long strings(about thousand characters) in one of the columns in a table using sqlite without any problems. When I did it with mysql, it truncated the string by itself with less than 300 characters left. It did that on every long string in the table. I did not change any ruby code except the yml file. Did I miss something? Thanks in advance. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tue, Feb 2, 2010 at 11:36 AM, Ichiro Saga <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi, there. I have an application running with sqlite in development mode > and production mode. I just installed mysql on windows and created a > new database in mysql for the application in development mode.> Did I miss something?Your MySQL field definitions obviously don''t match the data you''re trying to store there. Did you create it by hand or using rake and migrations/schema load? -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hassan Schroeder wrote:> On Tue, Feb 2, 2010 at 11:36 AM, Ichiro Saga <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> > wrote: >> Hi, there. I have an application running with sqlite in development mode >> and production mode. �I just installed mysql on windows and created a >> new database in mysql for the application in development mode. > >> Did I miss something? > > Your MySQL field definitions obviously don''t match the data you''re > trying to store there. > > Did you create it by hand or using rake and migrations/schema load? > > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > twitter: @hassanHi, Hassan. I ran: rake db:create rake db:migrate also tried: rake db:create rake db:schema:load both have the same problem mentioned in the previous post. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tue, Feb 2, 2010 at 2:08 PM, Ichiro Saga <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:>> Your MySQL field definitions obviously don''t match the data you''re >> trying to store there.> both have the same problem mentioned in the previous post.Somewhat surprising, but still -- if it''s wrong, it''s wrong. What does `show create table` say about the fields that are failing for specific inputs? -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hassan Schroeder wrote:> On Tue, Feb 2, 2010 at 2:08 PM, Ichiro Saga <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> > wrote: > >>> Your MySQL field definitions obviously don''t match the data you''re >>> trying to store there. > >> both have the same problem mentioned in the previous post. > > Somewhat surprising, but still -- if it''s wrong, it''s wrong. What does > `show create table` say about the fields that are failing for specific > inputs? > > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > twitter: @hassanunder Type, it''s "varchar(255)" -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tue, Feb 2, 2010 at 2:43 PM, Ichiro Saga <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> under Type, it''s "varchar(255)"So if you want to store more than 255 characters, as you indicated earlier, you need to change that field :-) Not too surprising, eh? -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hassan Schroeder wrote:> On Tue, Feb 2, 2010 at 2:43 PM, Ichiro Saga <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> > wrote: > >> under Type, it''s "varchar(255)" > > So if you want to store more than 255 characters, as you indicated > earlier, you need to change that field :-) > > Not too surprising, eh? > > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > twitter: @hassanOh. How can I change that field? When I checked the same field in sqlite3, it is also "varchar(255)". Could you please explain it a little more? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ichiro Saga wrote:> Hassan Schroeder wrote: >> On Tue, Feb 2, 2010 at 2:43 PM, Ichiro Saga <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> >> wrote: >> >>> under Type, it''s "varchar(255)" >> >> So if you want to store more than 255 characters, as you indicated >> earlier, you need to change that field :-) >> >> Not too surprising, eh? >> >> -- >> Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org >> twitter: @hassan > > Oh. How can I change that field? > When I checked the same field in sqlite3, it is also "varchar(255)". > Could you please explain it a little more?It works! Thanks Hassan. But still not sure why sqlite3 has "varchar(255)" as well. Maybe that''s not the real length of the field. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tue, Feb 2, 2010 at 3:44 PM, Ichiro Saga <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> It works! Thanks Hassan. But still not sure why sqlite3 has > "varchar(255)" as well. Maybe that''s not the real length of the field.Apparently that''s just a serving suggestion in SQLite3 -- it doesn''t even issue a warning; MySQL does :-) -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.