mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Put the create_table block in a transaction.
This will solve the issue that abort the connection transaction when we skip the tests.
This commit is contained in:
parent
a690935804
commit
4fa2f10494
1 changed files with 4 additions and 2 deletions
|
@ -12,8 +12,10 @@ class PostgresqlJSONTest < ActiveRecord::TestCase
|
|||
def setup
|
||||
@connection = ActiveRecord::Base.connection
|
||||
begin
|
||||
@connection.create_table('json_data_type') do |t|
|
||||
t.json 'payload', :default => {}
|
||||
@connection.transaction do
|
||||
@connection.create_table('json_data_type') do |t|
|
||||
t.json 'payload', :default => {}
|
||||
end
|
||||
end
|
||||
rescue ActiveRecord::StatementInvalid
|
||||
return skip "do not test on PG without json"
|
||||
|
|
Loading…
Reference in a new issue