Rick DeNatale
2007-Oct-24 14:15 UTC
Patch to allow Mysql adapter to properly handle non-standard key on schema dump
http://dev.rubyonrails.org/ticket/9971 This one cost me a few hours trying to debug my test cases when I really needed to be debugging ActiveRecord. If you define a table with a key other than id, the db/schema.db will NOT define any primary key for the table. ActiveRecord::SchemaDumper has a mechanism to handle this but the mysql adapter wasn''t playing the game. Please have a look at this patch and verify it. It passes both the existing mysql regression tests (i.e rake test_mysql), and the test I added to test this specific use case. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Rick DeNatale
2007-Oct-24 16:39 UTC
Re: Patch to allow Mysql adapter to properly handle non-standard key on schema dump
Oops, It looks like the edge testing setup changed out from under me so that the patch won''t apply to edge. I''ll update the patch once I''ve figured it out. On 10/24/07, Rick DeNatale <rick.denatale@gmail.com> wrote:> http://dev.rubyonrails.org/ticket/9971 > > This one cost me a few hours trying to debug my test cases when I > really needed to be debugging ActiveRecord. > > If you define a table with a key other than id, the db/schema.db will > NOT define any primary key for the table. ActiveRecord::SchemaDumper > has a mechanism to handle this but the mysql adapter wasn''t playing > the game. > > Please have a look at this patch and verify it. > > It passes both the existing mysql regression tests (i.e rake > test_mysql), and the test I added to test this specific use case. > > -- > Rick DeNatale > > My blog on Ruby > http://talklikeaduck.denhaven2.com/ >-- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Rick DeNatale
2007-Oct-24 17:30 UTC
Re: Patch to allow Mysql adapter to properly handle non-standard key on schema dump
On 10/24/07, Rick DeNatale <rick.denatale@gmail.com> wrote:> Oops, > > It looks like the edge testing setup changed out from under me so that > the patch won''t apply to edge. > > I''ll update the patch once I''ve figured it out.I attached a new patch which fixes the test case which was broken since a switch was made to use ruby schema instead of sql to set up the test databases for ActiveRecord testing. The actual code was unaffected. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---