So I at least created a work around that I posted here: https://gist.github.com/819792
That allows me to basically create a new column and copy the data to the new column and then delete the old column. The Text datatype is still giving me issues so I've been using String, :length=>10000... but that feels nasty... Still researching if anyone has suggestions. On Feb 9, 12:35 am, Justin Bozonier <[email protected]> wrote: > Issue is that I can't change a column type to 'Text' > > This is the error I am seeing: > > DarkBook:playground Justin$ rake migrate_up > (in /Users/Justin/Dropbox/Business/datamapper/playground) > ~ Starting Migration > == Performing Up Migration #1: create_person_table > CREATE TABLE `people` (`id` SERIAL PRIMARY KEY, `name` VARCHAR(2), > `age` INTEGER) ENGINE = InnoDB CHARACTER SET utf8 COLLATE > utf8_general_ci > -> 0.0112s > -> 0.0129s > == Performing Up Migration #2: change_name_constraints > rake aborted! > uninitialized constant SQL::TableModifier::Text > /Users/Justin/Dropbox/Business/datamapper/playground/rakefile.rb:61:in > `block (3 levels) in <top (required)>' > (See full trace by running task with --trace) > > Rake script I'm using to test DataMapper:https://gist.github.com/818143 > > It **seems** as though the change_column method within the > TableModifier class isn't converting the column change statement to > MySQL correctly. Other seemingly related errors are that if I try to > convert a column to a String of longer length I get this: > > DarkBook:playground Justin$ rake migrate_up > (in /Users/Justin/Dropbox/Business/datamapper/playground) > ~ Starting Migration > == Performing Up Migration #2: change_name_constraints > ALTER TABLE `people` ALTER COLUMN `name` TYPE String > ~ You have an error in your SQL syntax; check the manual that > corresponds to your MySQL server version for the right syntax to use > near 'TYPE String' at line 1 (code: 1064, sql state: 42000, query: > ALTER TABLE `people` ALTER COLUMN `name` TYPE String, uri: > mysql://root:@127.0.0.1datamapper_test) > rake aborted! > You have an error in your SQL syntax; check the manual that > corresponds to your MySQL server version for the right syntax to use > near 'TYPE String' at line 1 > /Users/Justin/Dropbox/Business/datamapper/playground/rakefile.rb:60:in > `block (2 levels) in <top (required)>' > (See full trace by running task with --trace) > > According to what I've read about MySQL, "ALTER TABLE `people` ALTER > COLUMN `name` TYPE String" is not a valid MySQL query command. TYPE > shouldn't be there and String should be converted to VARCHAR. > > Looking inside the change_column method I see it's just a straight > pass through of the type I'm providing. This is making me think > perhaps I'm not supposed to be calling the change_column method > directly? > > Once I get this figured out and I'm well on my way, I'm documenting > this stuff as figuring out DataMapper's migration api has been > hellish. > > Thanks in advance for your help guys > > Justin -- You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/datamapper?hl=en.
