# Migration error, mysql, change column limit

**URL:** <https://www.ruby-forum.com/t/migration-error-mysql-change-column-limit/154150>\
**Category:** Rails\
**Created:** [November 25, 2008, 10:24pm UTC](https://www.ruby-forum.com/t/migration-error-mysql-change-column-limit/154150 "2008-11-25T22:24:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrochkind](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/779978/32.png) [@jrochkind](https://www.ruby-forum.com/u/jrochkind)\
**Post date:** [November 25, 2008, 10:24pm UTC](https://www.ruby-forum.com/t/migration-error-mysql-change-column-limit/154150/1 "2008-11-25T22:24:15Z")

</div>

Hmm, one of my migrations have stopped working on #down. It still works  
on #up. (It’s also possible that I never tested it for #down before, and  
it never worked, heh.)

I can’t figure out why not. Pretty simple.

class WidenRequestParams \< ActiveRecord::Migration  
def self.up  
change\_column :requests, :params, :string, :limit =\> 2048  
end

def self.down  
change\_column :requests, :params, :string, :limit =\> 1024  
end  
end

Up works fine. Down tells me:

Mysql::Error: 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 ‘limit1024 DEFAULT NULL’ at line 1: ALTER TABLE `requests`  
CHANGE `params` `params` limit1024 DEFAULT NULL

Why is it messing up the SQL on ‘down’, but not ‘up’? Very weird.  
Anyone have any ideas?

---

<div class="post-metadata">

**Author:** ![jrochkind](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/779978/32.png) [@jrochkind](https://www.ruby-forum.com/u/jrochkind)\
**Post date:** [November 25, 2008, 10:45pm UTC](https://www.ruby-forum.com/t/migration-error-mysql-change-column-limit/154150/2 "2008-11-25T22:45:30Z")

</div>

Nevermind, as usual my own stupid error.

Jonathan R. wrote:

> Hmm, one of my migrations have stopped working on #down. It still works  
> on #up. (It’s also possible that I never tested it for #down before, and  
> it never worked, heh.)
