Help with tests/rake issues

Rafael Szuminski
Sun, 18 Mar 2007 23:09:15 -0000

Hi All,

I have run into an odd issue in rails/tests (it might actually be a
bug). Unlike most rails apps, I have changed the id column in my
tables to be char(32). There are many reasons for this, so don''t ask
;-)

Anyhow, my migrations work just fine and create the tables etc but I
have run into issues with testing. For some reason rake
db:test:prepare clones my dev db but switches all the id fields back
to int. I suspect that rake uses schema.rb to create the test database
and that would explain the wrong id type since the schema.rb produced
after each migration omits the id fields.

So, my migration looks like this:

create_table "activities", :id=>false, :force => true do |t|
  t.column :id, :string, :limit => 32, :null => false
  t.column "activity_name", :string,   :limit => 50
end

but once the migration runs the above table is represented in
schema.rb like this:

create_table "activities", :force => true do |t|
  t.column "activity_name", :string,   :limit => 50
end

(rake db:schema:dump also omits ids)

So it looks like the solution might be either:
1. Fix rake to dump correct schema
2. Make rake clone the dev db in some other way

Any ideas?

Thanks

Raf



--
http://www.bdcsoftware.com" - Automotive CRM

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---