Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

rename_column sql syntax is incorrect #32

Open
cgunnels opened this issue Sep 21, 2011 · 4 comments
Open

rename_column sql syntax is incorrect #32

cgunnels opened this issue Sep 21, 2011 · 4 comments

Comments

@cgunnels
Copy link

please see http://dev.mysql.com/doc/refman/5.1/en/alter-table.html

dm-migrations / lib / dm-migrations / sql / table_modifier.rb

you need to change the sql syntax to look like this:
"ALTER TABLE #{quoted_table_name} CHANGE #{quote_column_name(name)} #{quote_column_name(new_name)}"

According to the docs this is correct syntax, also try running the current syntax via a ui or command line and you will get an error.

@cgunnels
Copy link
Author

This is using the mysql adapter.

@stephankaag
Copy link

+1

@postmodern
Copy link
Member

+1

We need to add an MySQL adapter specific method for this, similar to change_column_type_statement. I might try to fix this.

@jgr
Copy link

jgr commented Jun 29, 2012

Looks like this was fixed in b408d64 and 9eb1f5b.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants