diff options
author | Rafael França <rafael@franca.dev> | 2019-07-25 10:19:04 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-25 10:19:04 -0400 |
commit | 4ee88df6a01eadd8abbb07f2c17821a9512f51d0 (patch) | |
tree | 1a2a1c6255650485ca3b5513f47cac316930d813 /activerecord/test | |
parent | 3ecaf0aafa43ff6fd511c6557592591ee5731244 (diff) | |
parent | ec0dc76c06a0b7afadab7ca5629a8d6a2f3d6370 (diff) | |
download | rails-4ee88df6a01eadd8abbb07f2c17821a9512f51d0.tar.gz rails-4ee88df6a01eadd8abbb07f2c17821a9512f51d0.tar.bz2 rails-4ee88df6a01eadd8abbb07f2c17821a9512f51d0.zip |
Merge pull request #36740 from stanhu/sh-fix-index-exists-postgresql-partial-index
Fix index_exists? for PostgreSQL expression indexes
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb b/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb index d99593817a..830c0892d3 100644 --- a/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb +++ b/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb @@ -253,9 +253,11 @@ module ActiveRecord def test_expression_index with_example_table do - @connection.add_index "ex", "mod(id, 10), abs(number)", name: "expression" + expr = "mod(id, 10), abs(number)" + @connection.add_index "ex", expr, name: "expression" index = @connection.indexes("ex").find { |idx| idx.name == "expression" } - assert_equal "mod(id, 10), abs(number)", index.columns + assert_equal expr, index.columns + assert_equal true, @connection.index_exists?("ex", expr, name: "expression") end end |