diff options
author | Max Lapshin <max@maxidoors.ru> | 2009-04-20 20:08:51 +0400 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-04-21 11:42:40 +0100 |
commit | cdcd638c2f27ebf98ba7aa59512547f58a5e0c61 (patch) | |
tree | 6673b667fd9daa818962d969724adc6a5306741d /activerecord/test | |
parent | b10fb7e7bcb5efea6c93ae52bad125887cfc235c (diff) | |
download | rails-cdcd638c2f27ebf98ba7aa59512547f58a5e0c61.tar.gz rails-cdcd638c2f27ebf98ba7aa59512547f58a5e0c61.tar.bz2 rails-cdcd638c2f27ebf98ba7aa59512547f58a5e0c61.zip |
Fixed wrong quoting of index names in postgres [#2402 state:resolved]
Signed-off-by: Tarmo Tänav <tarmo@itech.ee>
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/schema_test_postgresql.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/cases/schema_test_postgresql.rb b/activerecord/test/cases/schema_test_postgresql.rb index 2d36bd0b22..ed8e1d22e3 100644 --- a/activerecord/test/cases/schema_test_postgresql.rb +++ b/activerecord/test/cases/schema_test_postgresql.rb @@ -113,6 +113,16 @@ class SchemaTest < ActiveRecord::TestCase do_dump_index_tests_for_schema(SCHEMA2_NAME, INDEX_A_COLUMN, INDEX_B_COLUMN_S2) end + def test_with_uppercase_index_name + ActiveRecord::Base.connection.execute "CREATE INDEX \"things_Index\" ON #{SCHEMA_NAME}.things (name)" + assert_nothing_raised { ActiveRecord::Base.connection.remove_index :things, :name => "#{SCHEMA_NAME}.things_Index"} + + ActiveRecord::Base.connection.execute "CREATE INDEX \"things_Index\" ON #{SCHEMA_NAME}.things (name)" + ActiveRecord::Base.connection.schema_search_path = SCHEMA_NAME + assert_nothing_raised { ActiveRecord::Base.connection.remove_index :things, :name => "things_Index"} + ActiveRecord::Base.connection.schema_search_path = "public" + end + private def columns(table_name) @connection.send(:column_definitions, table_name).map do |name, type, default| |