diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-02-01 16:01:38 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-02-01 16:01:38 -0200 |
commit | 83ea905fd106872841bf7219f108ef9d2299d86a (patch) | |
tree | 3fad27489fa98dfecb1c1b87926fc7a04ab99196 /activerecord/test | |
parent | e9be1c1e80f4e7efeb1c231505c28b95f901ff8b (diff) | |
parent | a099d7d97f80236185f1994a76a4366b2a5e21ab (diff) | |
download | rails-83ea905fd106872841bf7219f108ef9d2299d86a.tar.gz rails-83ea905fd106872841bf7219f108ef9d2299d86a.tar.bz2 rails-83ea905fd106872841bf7219f108ef9d2299d86a.zip |
Merge pull request #13688 from jbaudanza/psql-index-exists
PostgreSQL implementation of SchemaStatements#index_name_exists?
Conflicts:
activerecord/CHANGELOG.md
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/schema_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/schema_test.rb b/activerecord/test/cases/adapters/postgresql/schema_test.rb index 1e59bca6a7..3f7009c1d1 100644 --- a/activerecord/test/cases/adapters/postgresql/schema_test.rb +++ b/activerecord/test/cases/adapters/postgresql/schema_test.rb @@ -246,6 +246,18 @@ class SchemaTest < ActiveRecord::TestCase assert_nothing_raised { with_schema_search_path nil } end + def test_index_name_exists + with_schema_search_path(SCHEMA_NAME) do + assert @connection.index_name_exists?(TABLE_NAME, INDEX_A_NAME, true) + assert @connection.index_name_exists?(TABLE_NAME, INDEX_B_NAME, true) + assert @connection.index_name_exists?(TABLE_NAME, INDEX_C_NAME, true) + assert @connection.index_name_exists?(TABLE_NAME, INDEX_D_NAME, true) + assert @connection.index_name_exists?(TABLE_NAME, INDEX_E_NAME, true) + assert @connection.index_name_exists?(TABLE_NAME, INDEX_E_NAME, true) + assert_not @connection.index_name_exists?(TABLE_NAME, 'missing_index', true) + end + end + def test_dump_indexes_for_schema_one do_dump_index_tests_for_schema(SCHEMA_NAME, INDEX_A_COLUMN, INDEX_B_COLUMN_S1, INDEX_D_COLUMN, INDEX_E_COLUMN) end |