Permalink
Browse files

Merge pull request #13093 from ccutrer/fix-mysql-version-check

fix mysql version check in rename_index
  • Loading branch information...
2 parents 948c0ff + 664c7bb commit b782731ce345d94d0929f284ea0c025005798380 @senny senny committed Nov 29, 2013
@@ -1,4 +1,4 @@
-* Implement rename_index natively for MySQL > 5.7.
+* Implement rename_index natively for MySQL >= 5.7.
*Cody Cutrer*
@@ -488,7 +488,7 @@ def rename_table(table_name, new_name)
end
def rename_index(table_name, old_name, new_name)
- if version[0] >= 5 && version[1] >= 7
+ if (version[0] == 5 && version[1] >= 7) || version[0] >= 6
execute "ALTER TABLE #{quote_table_name(table_name)} RENAME INDEX #{quote_table_name(old_name)} TO #{quote_table_name(new_name)}"
else
super

0 comments on commit b782731

Please sign in to comment.