aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-02-25 14:14:45 +0100
committerYves Senn <yves.senn@gmail.com>2014-02-25 14:14:45 +0100
commit6d35190bad0b054c9a1f4c736dc4dda32a7ebc91 (patch)
tree11b5b10f8e2c3a6ffd75a656faa28a55de510eca
parent7aa500d2edcc2a2990e7a72799661d4a1227d441 (diff)
parentd64673c8fe00539a5e5c21c334d92f689e916444 (diff)
downloadrails-6d35190bad0b054c9a1f4c736dc4dda32a7ebc91.tar.gz
rails-6d35190bad0b054c9a1f4c736dc4dda32a7ebc91.tar.bz2
rails-6d35190bad0b054c9a1f4c736dc4dda32a7ebc91.zip
Merge pull request #14177 from yahonda/skip_tests_if_duplicate_index_not_allowed
Skip test_migrate_revert_add_index_with_name for some databases
-rw-r--r--activerecord/test/cases/invertible_migration_test.rb23
1 files changed, 13 insertions, 10 deletions
diff --git a/activerecord/test/cases/invertible_migration_test.rb b/activerecord/test/cases/invertible_migration_test.rb
index debacf815c..2b1749cf70 100644
--- a/activerecord/test/cases/invertible_migration_test.rb
+++ b/activerecord/test/cases/invertible_migration_test.rb
@@ -271,16 +271,19 @@ module ActiveRecord
ActiveRecord::Base.table_name_prefix = ActiveRecord::Base.table_name_suffix = ''
end
- def test_migrate_revert_add_index_with_name
- RevertNamedIndexMigration1.new.migrate(:up)
- RevertNamedIndexMigration2.new.migrate(:up)
- RevertNamedIndexMigration2.new.migrate(:down)
-
- connection = ActiveRecord::Base.connection
- assert connection.index_exists?(:horses, :content),
- "index on content should exist"
- assert !connection.index_exists?(:horses, :content, name: "horses_index_named"),
- "horses_index_named index should not exist"
+ # MySQL 5.7 and Oracle do not allow to create duplicate indexes on the same columns
+ unless current_adapter?(:MysqlAdapter, :Mysql2Adapter, :OracleAdapter)
+ def test_migrate_revert_add_index_with_name
+ RevertNamedIndexMigration1.new.migrate(:up)
+ RevertNamedIndexMigration2.new.migrate(:up)
+ RevertNamedIndexMigration2.new.migrate(:down)
+
+ connection = ActiveRecord::Base.connection
+ assert connection.index_exists?(:horses, :content),
+ "index on content should exist"
+ assert !connection.index_exists?(:horses, :content, name: "horses_index_named"),
+ "horses_index_named index should not exist"
+ end
end
end