Permalink
Browse files

again - fix for mysql rename

  • Loading branch information...
1 parent b408d64 commit 44c8c6739b5795e736a98d00f96ed249cbf97e95 @rindek rindek committed with dkubb Nov 29, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/dm-migrations/sql/mysql.rb
@@ -42,7 +42,8 @@ def change_column_type_statement(name, column)
end
def rename_column_type_statement(table_name, old_col, new_col)
- "ALTER TABLE #{quote_name(table_name)} CHANGE #{quote_name(old_col)} #{quote_name(new_col)}"
+ table_info = select("SHOW COLUMNS FROM #{quote_name(table_name)} LIKE ?", old_col).first
+ "ALTER TABLE #{quote_name(table_name)} CHANGE #{quote_name(old_col)} #{quote_name(new_col)} #{table_info.type}"
end
class Table

0 comments on commit 44c8c67

Please sign in to comment.