Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

db:schema:dump saves enum columns as varchar(0) on MySQL

#997

I have a gender enum('M', 'F') column on a MySQL table (MyISAM engine). When I invoke rake db:schema:dump, Rails writes this column as:

t.string "gender", :limit => 0

Even if full support for enum types is not planned/desired, it should at the very least create a column with enough room for the largest possible value for that enumeration.

The null/not null constraint is correctly preserved.

Reported by Daniel Luz · September 8th, 2008 @ 09:16 PM

State: wontfix
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Pratik
    Pratik
    • State changed from new to wontfix

    I'll reopen once we have a patch for this.

    Thanks.

    December 20th, 2008 @ 03:29 PM

  2. Joe McGlynn
    Joe McGlynn
    • Importance changed from to

    This problem still exists in Rails 3, using rake db:schema:dump on a mysql table with an enum column creates an invalid schema.rb file.

    November 2nd, 2010 @ 02:02 PM