Rails migration problem
Maybe this isn’t a migration problem, but I’m looking for a solution from within the migration file. I believe it’s a MySQL problem, in the event that you try to set a default value to a column of type :text. It doesn’t allow this, which in turn, halts the migration. Here’s what I have:
1 2 3 4 5 6 7 8 9 10 11 | class TextLengthUpdate < ActiveRecord::Migration self.up # change_column, :tablename, :field_name, :datatype, :options change_column :comments, :body, :text ... end self.down ... end end |
When it returns the MySQL error, it shows that it’s trying to specify a DEFAULT '', which is why it’s breaking. How can I tell the migration to not set a default? Any thoughts?

Chris Thursday, 04 Jan, 2007 Posted at 05:11PM
Check this out: Rails ticket #6695
Sounds like a Rails bug.
Ryan Thursday, 04 Jan, 2007 Posted at 05:27PM
That explains it. Thanks…