I use this naming convention for primary keys: ActiveRecord::Base.primary_key_prefix_type = :table_name_with_underscore I generate the MySQL test database: rake db:test:prepare, and although the column is there there is no primary key enforcement/index and no autoincrement (so activerecord saves fail). Is this a bug? What is the best workaround? Alan --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Bob Showalter
2007-Oct-16 20:46 UTC
Re: Primary Keys enforcement vanishes in test database
On 10/16/07, Alan <aheckman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I use this naming convention for primary keys: > > ActiveRecord::Base.primary_key_prefix_type > = :table_name_with_underscore > > I generate the MySQL test database: rake db:test:prepare, and although > the column is there there is no primary key enforcement/index and no > autoincrement (so activerecord saves fail). Is this a bug? What is > the best workaround?Looks like a bug: http://dev.rubyonrails.org/ticket/7085 Does using rake db:test:clone_structure do the job? see http://brighter.net/2007/8/15/keeping-your-test-db-in-sync --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
That''s the ticket! rake db:test:clone_structure is the successful workaround Thanks! On Oct 16, 1:46 pm, "Bob Showalter" <showa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 10/16/07, Alan <aheck...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > I use this naming convention for primary keys: > > > ActiveRecord::Base.primary_key_prefix_type > > = :table_name_with_underscore > > > I generate the MySQL test database: rake db:test:prepare, and although > > the column is there there is no primary key enforcement/index and no > > autoincrement (so activerecord saves fail). Is this a bug? What is > > the best workaround? > > Looks like a bug:http://dev.rubyonrails.org/ticket/7085 > > Does using rake db:test:clone_structure do the job? seehttp://brighter.net/2007/8/15/keeping-your-test-db-in-sync--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---