I export all my dev data into yaml files so that they can be version controlled along with the migrations. On one of my tables I have a MySQL varchar field called ''name''. The yaml file for that table had numerical values populating name. So when it gets imported back into the DB with Fixtures.create_fixtures the data is getting munged. If the name field contains only digits, then it is being converted to hex. One name field Contained "0101" and it goes into the database as 65. If i modify the yaml file and stick a letter in front (so, "a0101") it goes up just fine. I ran this from the console and the Fixture command is returning the converted values. I would rather not change the field type, because there is a distinct possibility it will contain non numerical data. Has anyone run across this before? Thanks, C. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
almost forgot..I am running Rails 2.0.1 On Jan 4, 2:53 pm, Charles <rowe.char...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I export all my dev data into yaml files so that they can be version > controlled along with the migrations. On one of my tables I have a > MySQL varchar field called ''name''. The yaml file for that table had > numerical values populating name. So when it gets imported back into > the DB with Fixtures.create_fixtures the data is getting munged. If > the name field contains only digits, then it is being converted to > hex. One name field Contained "0101" and it goes into the database as > 65. If i modify the yaml file and stick a letter in front (so, > "a0101") it goes up just fine. > I ran this from the console and the Fixture command is returning the > converted values. > > I would rather not change the field type, because there is a distinct > possibility it will contain non numerical data. > > Has anyone run across this before? > > Thanks, > C.--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Quoting Charles <rowe.charles-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > I export all my dev data into yaml files so that they can be version > controlled along with the migrations. On one of my tables I have a > MySQL varchar field called ''name''. The yaml file for that table had > numerical values populating name. So when it gets imported back into > the DB with Fixtures.create_fixtures the data is getting munged. If > the name field contains only digits, then it is being converted to > hex. One name field Contained "0101" and it goes into the database as > 65. If i modify the yaml file and stick a letter in front (so, > "a0101") it goes up just fine. > I ran this from the console and the Fixture command is returning the > converted values. >Enclose the value in quotes and it will always be interpreted as a string. HTH, Jeffrey --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---