1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

because of Oracle database index length spec.
This commit is contained in:
Yasuo Honda 2013-02-24 11:54:18 +09:00
parent da5ca962af
commit 6fad6b5e5c

View file

@ -96,10 +96,18 @@ module ActiveRecord
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