# Missing table with test:units

**URL:** <https://www.ruby-forum.com/t/missing-table-with-test-units/127148>\
**Category:** Rails\
**Created:** [January 25, 2008, 2:11pm UTC](https://www.ruby-forum.com/t/missing-table-with-test-units/127148 "2008-01-25T14:11:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kula](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/b487fb/32.png) [@kula](https://www.ruby-forum.com/u/kula)\
**Post date:** [January 25, 2008, 2:11pm UTC](https://www.ruby-forum.com/t/missing-table-with-test-units/127148/1 "2008-01-25T14:11:59Z")

</div>

hi all,  
I’m trying to create tests for my app but “rake test:units” doesn’t  
create one table, even if other ware created properly. Migration file  
for this table is present, but if I create this table from finger and  
run test just for it everything it’s ok.  
I can’t find any explanation for this, mayby someone knows what’s going  
on.

---

<div class="post-metadata">

**Author:** ![kula](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/b487fb/32.png) [@kula](https://www.ruby-forum.com/u/kula)\
**Post date:** [January 28, 2008, 4:53pm UTC](https://www.ruby-forum.com/t/missing-table-with-test-units/127148/2 "2008-01-28T16:53:54Z")

</div>

I had an issue like this one time. What was more troubling was that I  
could rake db:fixtures load… FIXTURES=my\_table and then run an  
individual test against that model and it worked correctly. In my  
case the issue was related to using a :decimal column.

At any rate, you could see the root of the problem by opening /  
databases/schema.rb. The table that was not created in the test db  
was commented out in schema.rb with an additional comment about the  
ARec failure.

HTH,  
AndyV

On Jan 25, 8:11 am, Marcin K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![kula](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/b487fb/32.png) [@kula](https://www.ruby-forum.com/u/kula)\
**Post date:** [January 28, 2008, 9:43pm UTC](https://www.ruby-forum.com/t/missing-table-with-test-units/127148/3 "2008-01-28T21:43:18Z")

</div>

AndyV wrote:  
…

> At any rate, you could see the root of the problem by opening /  
> databases/schema.rb. The table that was not created in the test db  
> was commented out in schema.rb with an additional comment about the  
> ARec failure.

You’re right and thx for the help, but there’s one very strange think,  
I’ve got column declaration like this:

> > t.column :data\_ur, :year  
> > and I hadn’t any problems with migration, when I look in to DB  
> > declaration is:
> 
> > | data\_ur | year(4) | YES | | NULL | |  
> > and ruby in schema.rb is shouting this:
> 
> > # Could not dump table “mtp\_records” because of following StandardError
> > 
> > # Unknown type ‘year(4)’ for column ‘data\_ur’

Thus the question is how this problem can be solved without changeing  
datatype, because I’ve got only year for inserting not whole date  
datatype?
