diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-11-28 23:50:49 -0800 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-11-28 23:50:49 -0800 |
commit | b782731ce345d94d0929f284ea0c025005798380 (patch) | |
tree | 12e97f6650f8090e2ffe7075e0766930c85a54bd /activerecord | |
parent | 948c0ff1647eb3dd1b45add0d1748d393cd2fd50 (diff) | |
parent | 664c7bb361fa5dc5f8596256e714fae5b0f8b19a (diff) | |
download | rails-b782731ce345d94d0929f284ea0c025005798380.tar.gz rails-b782731ce345d94d0929f284ea0c025005798380.tar.bz2 rails-b782731ce345d94d0929f284ea0c025005798380.zip |
Merge pull request #13093 from ccutrer/fix-mysql-version-check
fix mysql version check in rename_index
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/CHANGELOG.md | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 126464f81f..5fd0c63c1b 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,4 +1,4 @@ -* Implement rename_index natively for MySQL > 5.7. +* Implement rename_index natively for MySQL >= 5.7. *Cody Cutrer* diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb index 3aa4604912..3d3c3ee79b 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -488,7 +488,7 @@ module ActiveRecord 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 |