mirror of https://github.com/rails/rails
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
|
@ -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 New Issue