Skip to content
Browse files

Oracle enhanced adapter shortens its name if it is longer than 30 bytes

because of Oracle database index length spec.
  • Loading branch information...
1 parent da5ca96 commit 6fad6b5e5c3bbaf23f577b2fdccf4b123dff726e @yahonda yahonda committed Feb 24, 2013
Showing with 10 additions and 2 deletions.
  1. +10 −2 activerecord/test/cases/migration/columns_test.rb
View
12 activerecord/test/cases/migration/columns_test.rb
@@ -96,10 +96,18 @@ def test_rename_column_with_multi_column_index
add_index "test_models", ["hat_style", "hat_size"], unique: true
rename_column "test_models", "hat_size", 'size'
- assert_equal ['index_test_models_on_hat_style_and_size'], connection.indexes('test_models').map(&:name)
+ if current_adapter? :OracleAdapter
+ assert_equal ['i_test_models_hat_style_size'], connection.indexes('test_models').map(&:name)
+ else
+ assert_equal ['index_test_models_on_hat_style_and_size'], connection.indexes('test_models').map(&:name)
+ end
rename_column "test_models", "hat_style", 'style'
- assert_equal ['index_test_models_on_style_and_size'], connection.indexes('test_models').map(&:name)
+ if current_adapter? :OracleAdapter
+ assert_equal ['i_test_models_style_size'], connection.indexes('test_models').map(&:name)
+ else
+ assert_equal ['index_test_models_on_style_and_size'], connection.indexes('test_models').map(&:name)
+ end
end
def test_rename_column_does_not_rename_custom_named_index

0 comments on commit 6fad6b5

Please sign in to comment.
Something went wrong with that request. Please try again.