# Help with tests/rake issues

**URL:** <https://www.ruby-forum.com/t/help-with-tests-rake-issues/89251>\
**Category:** Rails\
**Created:** [March 19, 2007, 12:10am UTC](https://www.ruby-forum.com/t/help-with-tests-rake-issues/89251 "2007-03-19T00:10:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maunzinha](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/839c29/32.png) [@maunzinha](https://www.ruby-forum.com/u/maunzinha)\
**Post date:** [March 19, 2007, 12:10am UTC](https://www.ruby-forum.com/t/help-with-tests-rake-issues/89251/1 "2007-03-19T00:10:32Z")

</div>

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](http://www.bdcsoftware.com)" - Automotive CRM
