# Patch - mysql double datatype

**URL:** <https://www.ruby-forum.com/t/patch-mysql-double-datatype/158104>\
**Category:** Rails\
**Created:** [January 19, 2009, 12:28pm UTC](https://www.ruby-forum.com/t/patch-mysql-double-datatype/158104 "2009-01-19T12:28:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jzimmek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d07c76/32.png) [@jzimmek](https://www.ruby-forum.com/u/jzimmek)\
**Post date:** [January 19, 2009, 12:28pm UTC](https://www.ruby-forum.com/t/patch-mysql-double-datatype/158104/1 "2009-01-19T12:28:36Z")

</div>

while porting some parts of our java-based plattform to rails i  
encounter some problems while using migrations and db:schema:dump. the  
database schema uses several “double” column types which are not  
supported natively in activerecord … as far as i know … and i  
cannot change the database schema.

from some blogs i know that “t.float :mycolumn :limit =\> 53” results  
in a generated column of type double.

this solved 50% of my problem, but running a “rake db:schema:dump”  
ignores the “limit 53” which will generate an invalid schema on next  
run of “rake db:schema:load”.

i think if found the relevant part in the mysql\_adapter.rb to patch  
this, but it would be great if some more experienced rails people  
could confirm this.

regards  
jan

\*\*\* mysql\_adapter.orig.rb 2009-01-19 12:09:58.000000000 +0100  
— mysql\_adapter.rb 2009-01-19 11:59:18.000000000 +0100

* * *

\*\*\* 116,121 \*\*\*\*  
— 116,122 ----  
else  
super # we could return 65535 here, but we leave it  
undecorated by default  
end

- 

```
      when /^double/i; 53
      when /^bigint/i; 8
      when /^int/i; 4
      when /^mediumint/i; 3

```

* * *

\*\*\* 504,509 \*\*\*\*  
— 505,511 ----  
when 3; ‘mediumint’  
when nil, 4, 11; ‘int(11)’ # compatibility with MySQL  
default  
when 5…8; ‘bigint’

- 

```
    when 53; 'double'
    else raise(ActiveRecordError, "No integer type has byte size

```

#{limit}")  
end  
end
