Forum: Ruby on Rails Rake problem with binary tables

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2bea2d8248b0523588d04204290bc3c6?d=identicon&s=25 oliver (Guest)
on 2008-10-26 09:55
(Received via mailing list)
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
A91bd6cef23eb3516245a092e196c4da?d=identicon&s=25 Maurício Linhares (mauricio)
on 2008-10-26 11:49
(Received via mailing list)
This seems to be a bug, add a ticket at the Rails lighthouse ->
http://rails.lighthouseapp.com/dashboard

On Sat, Oct 25, 2008 at 10:54 PM, oliver <oliverfriedrichs@gmail.com>
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/ (pt-br) | http://blog.codevader.com/
(en)
João Pessoa, PB, +55 83 8867-7208
2bea2d8248b0523588d04204290bc3c6?d=identicon&s=25 oliver (Guest)
on 2008-10-26 19:03
(Received via mailing list)
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" <mauricio.linha...@gmail.com>
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2008-10-26 19:14
(Received via mailing list)
On Oct 26, 6:01 pm, oliver <oliverfriedri...@gmail.com> 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/
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
This topic is locked and can not be replied to.