This project is archived and is in readonly mode.

#997 ✓wontfix
Daniel Luz

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

Reported by Daniel Luz | September 8th, 2008 @ 09:16 PM | in 2.x

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.

Comments and changes to this ticket

  • Pratik

    Pratik December 20th, 2008 @ 03:29 PM

    • State changed from “new” to “wontfix”

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

    Thanks.

  • Joe McGlynn

    Joe McGlynn November 2nd, 2010 @ 02:02 PM

    • 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.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages