diff options
author | Andrew White <pixeltrix@users.noreply.github.com> | 2017-03-29 14:39:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-29 14:39:02 +0100 |
commit | 55ccec637212a2232a64f86360b2a25fa1c25759 (patch) | |
tree | 37c2fc553e267d3c0072caa9bda3df419665c743 /activerecord/test | |
parent | a02fb802e9cb87f751c34c5a25c4b18cfc3b6a6a (diff) | |
parent | dbd2fc8907e7fa4756ea26c5c52334cd4baefd2b (diff) | |
download | rails-55ccec637212a2232a64f86360b2a25fa1c25759.tar.gz rails-55ccec637212a2232a64f86360b2a25fa1c25759.tar.bz2 rails-55ccec637212a2232a64f86360b2a25fa1c25759.zip |
Merge pull request #28478 from kamipo/fix_primary_keys_across_multiple_schemas
Fix `primary_keys` across multiple schemas
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/schema_test.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/schema_test.rb b/activerecord/test/cases/adapters/postgresql/schema_test.rb index 7b065ff320..75e30e4fe9 100644 --- a/activerecord/test/cases/adapters/postgresql/schema_test.rb +++ b/activerecord/test/cases/adapters/postgresql/schema_test.rb @@ -91,6 +91,7 @@ class SchemaTest < ActiveRecord::PostgreSQLTestCase @connection.execute "CREATE INDEX #{INDEX_E_NAME} ON #{SCHEMA_NAME}.#{TABLE_NAME} USING gin (#{INDEX_E_COLUMN});" @connection.execute "CREATE INDEX #{INDEX_E_NAME} ON #{SCHEMA2_NAME}.#{TABLE_NAME} USING gin (#{INDEX_E_COLUMN});" @connection.execute "CREATE TABLE #{SCHEMA_NAME}.#{PK_TABLE_NAME} (id serial primary key)" + @connection.execute "CREATE TABLE #{SCHEMA2_NAME}.#{PK_TABLE_NAME} (id serial primary key)" @connection.execute "CREATE SEQUENCE #{SCHEMA_NAME}.#{UNMATCHED_SEQUENCE_NAME}" @connection.execute "CREATE TABLE #{SCHEMA_NAME}.#{UNMATCHED_PK_TABLE_NAME} (id integer NOT NULL DEFAULT nextval('#{SCHEMA_NAME}.#{UNMATCHED_SEQUENCE_NAME}'::regclass), CONSTRAINT unmatched_pkey PRIMARY KEY (id))" end @@ -361,7 +362,7 @@ class SchemaTest < ActiveRecord::PostgreSQLTestCase end def test_primary_key_assuming_schema_search_path - with_schema_search_path(SCHEMA_NAME) do + with_schema_search_path("#{SCHEMA_NAME}, #{SCHEMA2_NAME}") do assert_equal "id", @connection.primary_key(PK_TABLE_NAME), "primary key should be found" end end |