# Rake problem with binary tables

**URL:** <https://www.ruby-forum.com/t/rake-problem-with-binary-tables/151818>\
**Category:** Rails\
**Created:** [October 26, 2008, 9:55am UTC](https://www.ruby-forum.com/t/rake-problem-with-binary-tables/151818 "2008-10-26T09:55:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oliver](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/85f322/32.png) [@oliver](https://www.ruby-forum.com/u/oliver)\
**Post date:** [October 26, 2008, 9:55am UTC](https://www.ruby-forum.com/t/rake-problem-with-binary-tables/151818/1 "2008-10-26T09:55:33Z")

</div>

Hello,

Excuse me if this is obvious. I have tried to find an answer to this  
problem without luck. A google search does not seem to show this as a  
common problem. I have an existing database, with a schema that has  
binary columns, and a default value for those columns (in this case  
“0000000000000000”).

I am trying to extract the schema using “rake --trace db:schema:dump”,  
and am getting the following error:

\*\* Execute db:schema:dump  
rake aborted!  
binary columns cannot have a default value: “0000000000000000”

Clearly it does not like default binary values; but why is this?  
Should I be doing something different in order to hook ROR up to my  
existing database?

Thanks in advance,

Oliver

---

<div class="post-metadata">

**Author:** ![oliver](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/85f322/32.png) [@oliver](https://www.ruby-forum.com/u/oliver)\
**Post date:** [October 26, 2008, 11:49am UTC](https://www.ruby-forum.com/t/rake-problem-with-binary-tables/151818/2 "2008-10-26T11:49:44Z")

</div>

This seems to be a bug, add a ticket at the Rails lighthouse →   
[http://rails.lighthouseapp.com/dashboard](http://rails.lighthouseapp.com/dashboard)

On Sat, Oct 25, 2008 at 10:54 PM, oliver [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I am trying to extract the schema using “rake --trace db:schema:dump”,  
> Thanks in advance,
> 
> Oliver
> 
> >

–  
Maurício Linhares  
[http://alinhavado.wordpress.com/](http://alinhavado.wordpress.com/) (pt-br) | [http://blog.codevader.com/](http://blog.codevader.com/)  
(en)  
João Pessoa, PB, +55 83 8867-7208

---

<div class="post-metadata">

**Author:** ![oliver](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/85f322/32.png) [@oliver](https://www.ruby-forum.com/u/oliver)\
**Post date:** [October 26, 2008, 7:03pm UTC](https://www.ruby-forum.com/t/rake-problem-with-binary-tables/151818/3 "2008-10-26T19:03:26Z")

</div>

Thank you Maurício, would you happen to have a suggestion for a  
workaround in the mean time?

Oliver

On Oct 26, 3:49 am, “Maurício Linhares” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![oliver](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/85f322/32.png) [@oliver](https://www.ruby-forum.com/u/oliver)\
**Post date:** [October 26, 2008, 7:14pm UTC](https://www.ruby-forum.com/t/rake-problem-with-binary-tables/151818/4 "2008-10-26T19:14:33Z")

</div>

On Oct 26, 6:01 pm, oliver [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thank you Maurício, would you happen to have a suggestion for a  
> workaround in the mean time?

This is probably an artefact of the fact that mysql blob columns  
genuinely cannot have defaults ([http://dev.mysql.com/doc/refman/5.0/en/](http://dev.mysql.com/doc/refman/5.0/en/)  
blob.html). BINARY/VARBINARY columns can, but rails does not  
differentiate between binary and blob - it would recreate the column  
as a blob and so defaults don’t make sense)

Fred
