Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Avoid postgres 9.X syntax

  • Loading branch information...
commit 51c2ef0b819d4732fff59cf1a86336dac38f2280 1 parent 9c172b2
@jonleighton jonleighton authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 activerecord/test/cases/adapters/postgresql/schema_test.rb
View
6 activerecord/test/cases/adapters/postgresql/schema_test.rb
@@ -68,11 +68,15 @@ def teardown
end
def test_schema_change_with_prepared_stmt
+ altered = false
@connection.exec_query "select * from developers where id = $1", 'sql', [[nil, 1]]
@connection.exec_query "alter table developers add column zomg int", 'sql', []
+ altered = true
@connection.exec_query "select * from developers where id = $1", 'sql', [[nil, 1]]
ensure
- @connection.exec_query "alter table developers drop column if exists zomg", 'sql', []
+ # We are not using DROP COLUMN IF EXISTS because that syntax is only
+ # supported by pg 9.X
+ @connection.exec_query("alter table developers drop column zomg", 'sql', []) if altered
end
def test_table_exists?
Please sign in to comment.
Something went wrong with that request. Please try again.