vincent fazio
2007-Aug-01 13:51 UTC
newbie - Problem running unit test because of text column
I''m new to Ruby and Rails and I''m having a problem.
I''ve creates a
ruby schema file defining a table containing a text column. I am able
to migrate this table to a MySQL database with no problem.
Here is the table definition from my migration file.
create_table "strings", :force => true do |t|
t.column "string", :text, :null => false
end
However, when I try to run the Rake target to run my unit tests, I
get the following error.
Mysql::Error: #42000BLOB/TEXT column ''string'' can''t
have a default
value:
CREATE TABLE strings (`id` int(11) DEFAULT NULL auto_increment
PRIMARY KEY, `string` text
DEFAULT '''' NOT NULL) ENGINE=InnoDB
Can anone tell me what''s going on here? I can figure out how to get
the DEFAULT '''' out of the generated SQL. Again, this does
not happen
when I run migrations. Does it use different code?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Apparently Analagous Threads
- help:How to set default value for a column use of migration?
- rake migrate says table already exists
- Migration - wrong SQL statement is created
- Best Forum? Was: Migration doesn''t seem to preserve create_table options in schema
- Problem with db_schema_import and MySQL timestamp!
