From 931be728258565a27d412cb87d210b3fdcb9a749 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 22 Mar 2024 11:40:38 -0400 Subject: [PATCH] Fix test of index names (now limited to 62 bytes by rails) See https://github.com/rails/rails/commit/3682aa1016e187398a7ae65e521f24f38b710d2b So the shortening of index names that was added to rails itself was almost immediately changed to use an 'idx_' prefix instead of an 'ix_' prefix. See https://github.com/rails/rails/commit/59f2b06493bed2c036f6b527e743198416ee1237 However, now that rails does shortening. It is an opportunity to simplify this library and just rely on the rails index name shortening. --- .../oracle_enhanced/schema_statements_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/active_record/connection_adapters/oracle_enhanced/schema_statements_spec.rb b/spec/active_record/connection_adapters/oracle_enhanced/schema_statements_spec.rb index f6bf2d21f..5dbc2cacb 100644 --- a/spec/active_record/connection_adapters/oracle_enhanced/schema_statements_spec.rb +++ b/spec/active_record/connection_adapters/oracle_enhanced/schema_statements_spec.rb @@ -330,7 +330,7 @@ class ::TestEmployee < ActiveRecord::Base; end it "should raise error if too large index name cannot be shortened" do if @oracle12cr2_or_higher expect(@conn.index_name("test_employees", column: ["first_name", "middle_name", "last_name"])).to eq( - ("index_test_employees_on_first_name_and_middle_name_and_last_name")) + ("idx_on_first_name_middle_name_last_name_ee1d3958bc")) else expect(@conn.index_name("test_employees", column: ["first_name", "middle_name", "last_name"])).to eq( "i" + OpenSSL::Digest::SHA1.hexdigest("index_test_employees_on_first_name_and_middle_name_and_last_name")[0, 29]