Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4017266
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:50:25+00:00 2026-05-20T09:50:25+00:00

Issue is that I can’t change a column type to ‘Text’ This is the

  • 0

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 ‘ 
(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 ‘ 
(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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T09:50:26+00:00Added an answer on May 20, 2026 at 9:50 am

    change_column isn’t particularly bright. The current implementation is:

    def change_column(name, type, opts = {})
      @statements << "ALTER TABLE #{quoted_table_name} ALTER COLUMN #{quote_column_name(name)} TYPE #{type}"
    end
    

    Meaning you need to specify the underlying sql type rather than a DataMapper type. To wit:

    modify_table :people do
      change_column :name, 'text'
    end
    

    I will update the documentation to include this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a pretty esoteric issue that I can't produce a small test case
Heyy can somebody help me ? i have this issue that still do know
I have this issue that I can't seem to get my head around... Basically
This is such a basic issue that I can only assume I'm looking at
I am having an issue that I can't seem to figure out. Hopefully somebody
I am having a strange issue that I can't seem to resolve. Here is
Hopefully someone can shed a little light on an issue that I'm currently having
I'm having an issue that I think is simple to diagnose, but I can't
I created a complete Visual Studio 2010 solution that can reproduce the issue here:
I have an nHibernate query issue that looks quite straight forward, but I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.