unconstrained 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8d05edc3199daf558da30f3d0cc90d57fd177487
4
+ data.tar.gz: 6b85606e59e0fc1786dfbe049f27ed259b002697
5
+ SHA512:
6
+ metadata.gz: 8db10e923a8b458c05b070cbcb7805e0d7119f60197c67185292dd4bb8da73e286643a7b72a06ad905b30ce1c71ae8e24f54954c1a0a2c0734bcbfa065c03df2
7
+ data.tar.gz: 2e8e454857106c9a05ef95a9cbbf92757ee35b984865d2a4c87a8097921cfbeb7e2274c887b52e01ecde3bb7094cf384a8fbc997e58e542d881255cf8649d16e
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2015 Alexandros Giouzenis
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,34 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'Unconstrained'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+
18
+
19
+
20
+
21
+
22
+ Bundler::GemHelper.install_tasks
23
+
24
+ require 'rake/testtask'
25
+
26
+ Rake::TestTask.new(:test) do |t|
27
+ t.libs << 'lib'
28
+ t.libs << 'test'
29
+ t.pattern = 'test/**/*_test.rb'
30
+ t.verbose = false
31
+ end
32
+
33
+
34
+ task default: :test
@@ -0,0 +1,19 @@
1
+ require 'unconstrained/active_record_plugin'
2
+ require 'unconstrained/handlers'
3
+ require 'unconstrained/handlers/abstract_handler'
4
+ require 'unconstrained/handlers/postgresql'
5
+
6
+ module Unconstrained
7
+ if defined?(Rails::Railtie)
8
+ class Railtie < Rails::Railtie
9
+ initializer 'unconstrained.insert_into_active_record' do
10
+ ActiveSupport.on_load :active_record do
11
+ ActiveRecord::Base.send(:include, Unconstrained::ActiveRecordPlugin)
12
+ end
13
+ end
14
+ end
15
+ else
16
+ ActiveRecord::Base.send(:include, Unconstrained::ActiveRecordPlugin) if defined?(ActiveRecord)
17
+ end
18
+ end
19
+
@@ -0,0 +1,43 @@
1
+ module Unconstrained
2
+ module ActiveRecordPlugin
3
+ extend ActiveSupport::Concern
4
+ included do
5
+ alias_data_modification_methods
6
+ end
7
+
8
+ module ClassMethods
9
+ def alias_data_modification_methods#:nodoc:
10
+ return if method_defined?( :save_without_constraints_handling )
11
+ alias_method_chain :save, :constraints_handling
12
+ alias_method_chain :destroy, :constraints_handling
13
+ end
14
+ end
15
+
16
+ protected
17
+
18
+ def save_with_constraints_handling
19
+ with_constraints_handling :save do
20
+ save_without_constraints_handling
21
+ end
22
+ end
23
+
24
+ def destroy_with_constraints_handling
25
+ with_constraints_handling :destroy do
26
+ destroy_without_constraints_handling
27
+ end
28
+ end
29
+
30
+ def with_constraints_handling action
31
+ begin
32
+ yield
33
+ rescue ActiveRecord::InvalidForeignKey, ActiveRecord::StatementInvalid => e
34
+ if Handlers.can_handle?( e )
35
+ Handlers.handle( action, e, self )
36
+ else
37
+ raise
38
+ end
39
+ end
40
+ end
41
+
42
+ end
43
+ end
@@ -0,0 +1,24 @@
1
+ module Unconstrained
2
+ module Handlers
3
+ @handlers = {}
4
+ class << self
5
+ def register exception_name, handler
6
+ @handlers[exception_name] = handler
7
+ end
8
+ def can_handle? exception
9
+ @handlers.include? exception.try(:original_exception).try(:class).try(:name)
10
+ end
11
+ def handle action, exception, record
12
+ e = exception.original_exception
13
+ h = @handlers[e.class.name].new(e, record)
14
+ case action
15
+ when :destroy
16
+ h.handle_destroy
17
+ when :save
18
+ h.handle_save
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+
@@ -0,0 +1,46 @@
1
+ module Unconstrained
2
+ module Handlers
3
+ class AbstractHandler
4
+ def initialize error, record
5
+ @error = error
6
+ @record = record
7
+ end
8
+
9
+ def handle_save
10
+ column_name = constraint_error_column
11
+ if column_name == @record.class.primary_key
12
+ @record.errors.add(:base, save_error_key, save_error_options)
13
+ else
14
+ @record.errors.add(column_name.to_sym, save_error_key, save_error_options)
15
+ end
16
+ end
17
+
18
+ def handle_destroy
19
+ @record.errors.add(:base, destroy_error_key, destroy_error_options)
20
+ end
21
+
22
+ def save_error_key
23
+ :invalid
24
+ end
25
+
26
+ def save_error_options
27
+ {}
28
+ end
29
+
30
+ def destroy_error_key
31
+ :"restrict_dependent_destroy.many"
32
+ end
33
+
34
+ def destroy_error_options
35
+ { record: constraint_error_table.humanize.downcase }
36
+ end
37
+
38
+ def constraint_error_column
39
+ end
40
+
41
+ def constraint_error_table
42
+ end
43
+ end
44
+ end
45
+ end
46
+
@@ -0,0 +1,15 @@
1
+ module Unconstrained
2
+ module Handlers
3
+ class PostgreSQLFKHandler < AbstractHandler
4
+ def constraint_error_column
5
+ @error.message =~ /DETAIL: Key \((\w+)\)/ && $1
6
+ end
7
+
8
+ def constraint_error_table
9
+ @error.message =~ /referenced from table "(\w+)"/ && $1
10
+ end
11
+ end
12
+ Handlers.register 'PG::ForeignKeyViolation', PostgreSQLFKHandler
13
+ end
14
+ end
15
+
@@ -0,0 +1,3 @@
1
+ module Unconstrained
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,18 @@
1
+ require 'test_helper'
2
+
3
+ class DestroyTest < ActiveSupport::TestCase
4
+ test "foreign key constraint converted to validation error" do
5
+ @parent = parents(:prolific)
6
+ assert_no_difference('Parent.count') do
7
+ @parent.destroy
8
+ end
9
+ assert_not_empty @parent.errors[:base]
10
+ end
11
+ test "destroyed without foreign key constraint" do
12
+ @parent = parents(:unfruitful)
13
+ assert_difference('Parent.count', -1) do
14
+ @parent.destroy
15
+ end
16
+ assert_empty @parent.errors[:base]
17
+ end
18
+ end
@@ -0,0 +1,5 @@
1
+ ENV["RAILS_ENV"] = "test"
2
+
3
+ require File.expand_path('../config/application', __FILE__)
4
+
5
+ Rails.application.load_tasks
@@ -0,0 +1,3 @@
1
+ class Child < ActiveRecord::Base
2
+ belongs_to :parent
3
+ end
@@ -0,0 +1,3 @@
1
+ class Parent < ActiveRecord::Base
2
+ has_many :children
3
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
@@ -0,0 +1,26 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require(*Rails.groups)
6
+ require "unconstrained"
7
+
8
+ module Dummy
9
+ class Application < Rails::Application
10
+ # Settings in config/environments/* take precedence over those specified here.
11
+ # Application configuration should go into files in config/initializers
12
+ # -- all .rb files in that directory are automatically loaded.
13
+
14
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
15
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
16
+ # config.time_zone = 'Central Time (US & Canada)'
17
+
18
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
19
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
20
+ # config.i18n.default_locale = :de
21
+
22
+ # Do not swallow errors in after_commit/after_rollback callbacks.
23
+ config.active_record.raise_in_transactional_callbacks = true
24
+ end
25
+ end
26
+
@@ -0,0 +1,5 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,10 @@
1
+ default: &default
2
+ adapter: postgresql
3
+ host: localhost
4
+ username: postgres
5
+ pool: 5
6
+ timeout: 5000
7
+
8
+ test:
9
+ <<: *default
10
+ database: unconstrained_test
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -0,0 +1,42 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
14
+
15
+ # Configure static file server for tests with Cache-Control for performance.
16
+ config.serve_static_files = true
17
+ config.static_cache_control = 'public, max-age=3600'
18
+
19
+ # Show full error reports and disable caching.
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Raise exceptions instead of rendering exception templates.
24
+ config.action_dispatch.show_exceptions = false
25
+
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+ # Tell Action Mailer not to deliver emails to the real world.
30
+ # The :test delivery method accumulates sent emails in the
31
+ # ActionMailer::Base.deliveries array.
32
+ config.action_mailer.delivery_method = :test
33
+
34
+ # Randomize the order test cases are executed.
35
+ config.active_support.test_order = :random
36
+
37
+ # Print deprecation notices to the stderr.
38
+ config.active_support.deprecation = :stderr
39
+
40
+ # Raises error for missing translations
41
+ # config.action_view.raise_on_missing_translations = true
42
+ end
Binary file
@@ -0,0 +1,10 @@
1
+ class ParentsWithChildren < ActiveRecord::Migration
2
+ def change
3
+ create_table :parents do |t|
4
+ end
5
+ create_table :children do |t|
6
+ t.references :parent
7
+ end
8
+ add_foreign_key :children, :parents
9
+ end
10
+ end
@@ -0,0 +1,28 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20150207083618) do
15
+
16
+ # These are extensions that must be enabled in order to support this database
17
+ enable_extension "plpgsql"
18
+ enable_extension "uuid-ossp"
19
+
20
+ create_table "children", force: :cascade do |t|
21
+ t.integer "parent_id"
22
+ end
23
+
24
+ create_table "parents", force: :cascade do |t|
25
+ end
26
+
27
+ add_foreign_key "children", "parents"
28
+ end
Binary file
@@ -0,0 +1,12 @@
1
+  (15.1ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2
+  (0.3ms) select sqlite_version(*)
3
+  (15.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
6
+ Migrating to ParentsWithChildren (20150207083618)
7
+  (0.1ms) begin transaction
8
+  (0.3ms) CREATE TABLE "parents" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL) 
9
+  (0.1ms) CREATE TABLE "children" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "parents_id" integer)
10
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150207083618"]]
11
+  (17.9ms) commit transaction
12
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
@@ -0,0 +1,1259 @@
1
+  (0.1ms) begin transaction
2
+ -----------------------------------
3
+ ActsAsUnconstrainedTest: test_truth
4
+ -----------------------------------
5
+  (0.0ms) rollback transaction
6
+  (0.1ms) begin transaction
7
+ -----------------------------
8
+ UnconstrainedTest: test_truth
9
+ -----------------------------
10
+  (0.0ms) rollback transaction
11
+  (11.8ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
12
+  (0.1ms) select sqlite_version(*)
13
+  (14.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
14
+  (0.1ms) SELECT version FROM "schema_migrations"
15
+  (14.2ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
16
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
17
+  (0.1ms) begin transaction
18
+ -----------------------------
19
+ UnconstrainedTest: test_truth
20
+ -----------------------------
21
+  (0.0ms) rollback transaction
22
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
23
+  (13.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
24
+  (0.2ms) select sqlite_version(*)
25
+  (11.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
26
+  (0.3ms) SELECT version FROM "schema_migrations"
27
+  (14.9ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
28
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
29
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
30
+  (11.8ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
31
+  (0.1ms) select sqlite_version(*)
32
+  (15.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
33
+  (0.4ms) SELECT version FROM "schema_migrations"
34
+  (13.2ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
35
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
36
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
37
+  (10.8ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
38
+  (0.1ms) select sqlite_version(*)
39
+  (13.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
40
+  (0.1ms) SELECT version FROM "schema_migrations"
41
+  (11.8ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
42
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
43
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
44
+  (15.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
45
+  (0.1ms) select sqlite_version(*)
46
+  (12.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
47
+  (0.2ms) SELECT version FROM "schema_migrations"
48
+  (12.8ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
49
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
50
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
51
+  (11.5ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
52
+  (0.1ms) select sqlite_version(*)
53
+  (9.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
54
+  (0.1ms) SELECT version FROM "schema_migrations"
55
+  (14.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
56
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
57
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
58
+  (13.3ms) CREATE TABLE "children" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "parents_id" integer) 
59
+  (8.2ms) CREATE TABLE "parents" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)
60
+  (14.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
61
+  (0.1ms) select sqlite_version(*)
62
+  (14.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
63
+  (0.3ms) SELECT version FROM "schema_migrations"
64
+  (13.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150207083618')
65
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
66
+  (0.1ms) begin transaction
67
+ -----------------------------
68
+ UnconstrainedTest: test_truth
69
+ -----------------------------
70
+  (0.0ms) rollback transaction
71
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
72
+  (0.1ms) begin transaction
73
+ -----------------------------
74
+ UnconstrainedTest: test_truth
75
+ -----------------------------
76
+  (0.0ms) rollback transaction
77
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
78
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
79
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
80
+  (0.1ms) begin transaction
81
+ ----------------------------------------------------------------------------
82
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
83
+ ----------------------------------------------------------------------------
84
+  (0.1ms) rollback transaction
85
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
86
+  (0.2ms) begin transaction
87
+ ----------------------------------------------------------------------------
88
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
89
+ ----------------------------------------------------------------------------
90
+  (0.1ms) rollback transaction
91
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
92
+  (0.1ms) begin transaction
93
+ ----------------------------------------------------------------------------
94
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
95
+ ----------------------------------------------------------------------------
96
+  (0.1ms) rollback transaction
97
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
98
+  (0.1ms) begin transaction
99
+ ----------------------------------------------------------------------------
100
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
101
+ ----------------------------------------------------------------------------
102
+  (0.0ms) rollback transaction
103
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
104
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
105
+  (0.1ms) begin transaction
106
+  (0.0ms) rollback transaction
107
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
108
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
109
+  (0.1ms) begin transaction
110
+  (0.0ms) rollback transaction
111
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
112
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
113
+ Migrating to ParentsWithChildren (20150207083618)
114
+  (0.1ms) begin transaction
115
+  (0.3ms) DROP TABLE "children"
116
+  (0.2ms) DROP TABLE "parents"
117
+ SQL (0.1ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = ? [["version", "20150207083618"]]
118
+  (13.4ms) commit transaction
119
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
120
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
121
+ Migrating to ParentsWithChildren (20150207083618)
122
+  (0.1ms) begin transaction
123
+  (0.3ms) CREATE TABLE "parents" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL) 
124
+  (0.2ms) CREATE TABLE "children" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "parent_id" integer)
125
+ SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150207083618"]]
126
+  (14.4ms) commit transaction
127
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
128
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
129
+  (0.1ms) begin transaction
130
+ Fixture Delete (0.1ms) DELETE FROM "children"
131
+ Fixture Insert (0.1ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
132
+ Fixture Delete (0.1ms) DELETE FROM "parents"
133
+ Fixture Insert (0.0ms) INSERT INTO "parents" ("id") VALUES (1024804656)
134
+ Fixture Insert (0.0ms) INSERT INTO "parents" ("id") VALUES (1002356086)
135
+  (15.2ms) commit transaction
136
+  (0.2ms) begin transaction
137
+ ----------------------------------------------------------------------------
138
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
139
+ ----------------------------------------------------------------------------
140
+ Parent Load (0.4ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = ? LIMIT 1 [["id", 1024804656]]
141
+  (0.1ms) SAVEPOINT active_record_1
142
+ SQL (0.1ms) DELETE FROM "parents" WHERE "parents"."id" = ? [["id", 1024804656]]
143
+  (0.0ms) RELEASE SAVEPOINT active_record_1
144
+  (0.1ms) rollback transaction
145
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
146
+  (0.1ms) begin transaction
147
+ Fixture Delete (0.1ms) DELETE FROM "children"
148
+ Fixture Insert (0.1ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
149
+ Fixture Delete (0.0ms) DELETE FROM "parents"
150
+ Fixture Insert (0.0ms) INSERT INTO "parents" ("id") VALUES (1024804656)
151
+ Fixture Insert (0.0ms) INSERT INTO "parents" ("id") VALUES (1002356086)
152
+  (14.6ms) commit transaction
153
+  (0.1ms) begin transaction
154
+ ----------------------------------------------------------------------------
155
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
156
+ ----------------------------------------------------------------------------
157
+ Parent Load (0.6ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = ? LIMIT 1 [["id", 1024804656]]
158
+  (0.2ms) SELECT COUNT(*) FROM "parents"
159
+  (0.1ms) SAVEPOINT active_record_1
160
+ SQL (0.3ms) DELETE FROM "parents" WHERE "parents"."id" = ? [["id", 1024804656]]
161
+  (0.1ms) RELEASE SAVEPOINT active_record_1
162
+  (0.1ms) SELECT COUNT(*) FROM "parents"
163
+  (0.2ms) rollback transaction
164
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
165
+  (0.1ms) begin transaction
166
+ Fixture Delete (0.1ms) DELETE FROM "children"
167
+ Fixture Insert (0.1ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
168
+ Fixture Delete (0.0ms) DELETE FROM "parents"
169
+ Fixture Insert (0.0ms) INSERT INTO "parents" ("id") VALUES (1024804656)
170
+ Fixture Insert (0.0ms) INSERT INTO "parents" ("id") VALUES (1002356086)
171
+  (17.7ms) commit transaction
172
+  (0.1ms) begin transaction
173
+ ----------------------------------------------------------------------------
174
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
175
+ ----------------------------------------------------------------------------
176
+ Parent Load (0.3ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = ? LIMIT 1 [["id", 1024804656]]
177
+  (0.1ms) SELECT COUNT(*) FROM "parents"
178
+  (0.1ms) SAVEPOINT active_record_1
179
+ SQL (0.1ms) DELETE FROM "parents" WHERE "parents"."id" = ? [["id", 1024804656]]
180
+  (0.1ms) RELEASE SAVEPOINT active_record_1
181
+  (0.1ms) SELECT COUNT(*) FROM "parents"
182
+  (0.1ms) rollback transaction
183
+  (27.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
184
+  (10.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
185
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
186
+ Migrating to ParentsWithChildren (20150207083618)
187
+  (0.1ms) BEGIN
188
+  (8.0ms) CREATE TABLE "parents" ("id" serial primary key) 
189
+  (6.1ms) CREATE TABLE "children" ("id" serial primary key, "parent_id" integer)
190
+  (1.5ms) ALTER TABLE "children" ADD CONSTRAINT "fk_rails_2d768a42d4"
191
+ FOREIGN KEY ("parent_id")
192
+ REFERENCES "parents" ("id")
193
+ 
194
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150207083618"]]
195
+  (3.4ms) COMMIT
196
+ ActiveRecord::SchemaMigration Load (1.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
197
+  (2.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
198
+ FROM pg_constraint c
199
+ JOIN pg_class t1 ON c.conrelid = t1.oid
200
+ JOIN pg_class t2 ON c.confrelid = t2.oid
201
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
202
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
203
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
204
+ WHERE c.contype = 'f'
205
+ AND t1.relname = 'children'
206
+ AND t3.nspname = ANY (current_schemas(false))
207
+ ORDER BY c.conname
208
+ 
209
+  (1.7ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
210
+ FROM pg_constraint c
211
+ JOIN pg_class t1 ON c.conrelid = t1.oid
212
+ JOIN pg_class t2 ON c.confrelid = t2.oid
213
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
214
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
215
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
216
+ WHERE c.contype = 'f'
217
+ AND t1.relname = 'parents'
218
+ AND t3.nspname = ANY (current_schemas(false))
219
+ ORDER BY c.conname
220
+
221
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
222
+  (5.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
223
+  (0.3ms) BEGIN
224
+ Fixture Delete (0.6ms) DELETE FROM "children"
225
+ Fixture Insert (0.6ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
226
+ Fixture Delete (1.2ms) DELETE FROM "parents"
227
+ Fixture Insert (0.7ms) INSERT INTO "parents" ("id") VALUES (1024804656)
228
+ Fixture Insert (0.6ms) INSERT INTO "parents" ("id") VALUES (1002356086)
229
+  (2.8ms) COMMIT
230
+  (2.1ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
231
+  (0.4ms) BEGIN
232
+ ----------------------------------------------------------------------------
233
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
234
+ ----------------------------------------------------------------------------
235
+ Parent Load (0.6ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
236
+  (0.5ms) SELECT COUNT(*) FROM "parents"
237
+  (0.3ms) SAVEPOINT active_record_1
238
+ SQL (1.4ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
239
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
240
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
241
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
242
+  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1
243
+  (0.3ms) ROLLBACK
244
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
245
+  (5.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
246
+  (0.4ms) BEGIN
247
+ Fixture Delete (0.7ms) DELETE FROM "children"
248
+ Fixture Insert (0.5ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
249
+ Fixture Delete (0.5ms) DELETE FROM "parents"
250
+ Fixture Insert (0.3ms) INSERT INTO "parents" ("id") VALUES (1024804656)
251
+ Fixture Insert (0.3ms) INSERT INTO "parents" ("id") VALUES (1002356086)
252
+  (1.8ms) COMMIT
253
+  (2.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
254
+  (0.3ms) BEGIN
255
+ ----------------------------------------------------------------------------
256
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
257
+ ----------------------------------------------------------------------------
258
+ Parent Load (0.5ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
259
+  (0.5ms) SELECT COUNT(*) FROM "parents"
260
+  (0.2ms) SAVEPOINT active_record_1
261
+ SQL (1.3ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
262
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
263
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
264
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
265
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
266
+  (0.3ms) ROLLBACK
267
+ ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
268
+  (5.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
269
+  (0.3ms) BEGIN
270
+ Fixture Delete (0.5ms) DELETE FROM "children"
271
+ Fixture Insert (0.4ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
272
+ Fixture Delete (0.5ms) DELETE FROM "parents"
273
+ Fixture Insert (0.3ms) INSERT INTO "parents" ("id") VALUES (1024804656)
274
+ Fixture Insert (0.2ms) INSERT INTO "parents" ("id") VALUES (1002356086)
275
+  (1.7ms) COMMIT
276
+  (3.1ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
277
+  (0.2ms) BEGIN
278
+ ----------------------------------------------------------------------------
279
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
280
+ ----------------------------------------------------------------------------
281
+ Parent Load (0.4ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
282
+  (0.3ms) SELECT COUNT(*) FROM "parents"
283
+  (0.2ms) SAVEPOINT active_record_1
284
+ SQL (1.0ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
285
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
286
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
287
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
288
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
289
+  (0.2ms) ROLLBACK
290
+ ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
291
+  (2.8ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
292
+  (0.2ms) BEGIN
293
+ Fixture Delete (0.7ms) DELETE FROM "children"
294
+ Fixture Insert (0.5ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
295
+ Fixture Delete (0.7ms) DELETE FROM "parents"
296
+ Fixture Insert (0.4ms) INSERT INTO "parents" ("id") VALUES (1024804656)
297
+ Fixture Insert (0.2ms) INSERT INTO "parents" ("id") VALUES (1002356086)
298
+  (3.4ms) COMMIT
299
+  (3.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
300
+  (0.5ms) BEGIN
301
+ ----------------------------------------------------------------------------
302
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
303
+ ----------------------------------------------------------------------------
304
+ Parent Load (0.6ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
305
+  (0.5ms) SELECT COUNT(*) FROM "parents"
306
+  (0.3ms) SAVEPOINT active_record_1
307
+ SQL (1.4ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
308
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
309
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
310
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
311
+  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1
312
+  (0.3ms) ROLLBACK
313
+ ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
314
+  (3.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
315
+  (0.4ms) BEGIN
316
+ Fixture Delete (0.6ms) DELETE FROM "children"
317
+ Fixture Insert (0.5ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
318
+ Fixture Delete (0.9ms) DELETE FROM "parents"
319
+ Fixture Insert (0.5ms) INSERT INTO "parents" ("id") VALUES (1024804656)
320
+ Fixture Insert (0.4ms) INSERT INTO "parents" ("id") VALUES (1002356086)
321
+  (3.0ms) COMMIT
322
+  (1.8ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
323
+  (0.2ms) BEGIN
324
+ ----------------------------------------------------------------------------
325
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
326
+ ----------------------------------------------------------------------------
327
+ Parent Load (0.3ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
328
+  (0.3ms) SELECT COUNT(*) FROM "parents"
329
+  (0.2ms) SAVEPOINT active_record_1
330
+ SQL (0.9ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
331
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
332
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
333
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
334
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
335
+  (0.2ms) ROLLBACK
336
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
337
+  (2.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
338
+  (0.2ms) BEGIN
339
+ Fixture Delete (0.3ms) DELETE FROM "children"
340
+ Fixture Insert (0.2ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
341
+ Fixture Delete (0.2ms) DELETE FROM "parents"
342
+ Fixture Insert (0.2ms) INSERT INTO "parents" ("id") VALUES (1024804656)
343
+ Fixture Insert (0.1ms) INSERT INTO "parents" ("id") VALUES (1002356086)
344
+  (2.3ms) COMMIT
345
+  (1.6ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
346
+  (0.1ms) BEGIN
347
+ ----------------------------------------------------------------------------
348
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
349
+ ----------------------------------------------------------------------------
350
+ Parent Load (0.3ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
351
+  (0.3ms) SELECT COUNT(*) FROM "parents"
352
+  (0.2ms) SAVEPOINT active_record_1
353
+ SQL (0.8ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
354
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
355
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
356
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
357
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
358
+  (0.2ms) ROLLBACK
359
+ ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
360
+  (4.1ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
361
+  (0.4ms) BEGIN
362
+ Fixture Delete (0.6ms) DELETE FROM "children"
363
+ Fixture Insert (0.4ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
364
+ Fixture Delete (0.6ms) DELETE FROM "parents"
365
+ Fixture Insert (0.5ms) INSERT INTO "parents" ("id") VALUES (1024804656)
366
+ Fixture Insert (0.5ms) INSERT INTO "parents" ("id") VALUES (1002356086)
367
+  (1.8ms) COMMIT
368
+  (3.5ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
369
+  (0.3ms) BEGIN
370
+ ----------------------------------------------------------------------------
371
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
372
+ ----------------------------------------------------------------------------
373
+ Parent Load (0.5ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
374
+  (0.4ms) SELECT COUNT(*) FROM "parents"
375
+  (0.3ms) SAVEPOINT active_record_1
376
+ SQL (1.3ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
377
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
378
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
379
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
380
+  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1
381
+  (0.2ms) ROLLBACK
382
+ ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
383
+  (5.9ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
384
+  (0.4ms) BEGIN
385
+ Fixture Delete (0.7ms) DELETE FROM "children"
386
+ Fixture Insert (0.8ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
387
+ Fixture Delete (0.7ms) DELETE FROM "parents"
388
+ Fixture Insert (0.4ms) INSERT INTO "parents" ("id") VALUES (1024804656)
389
+ Fixture Insert (0.4ms) INSERT INTO "parents" ("id") VALUES (1002356086)
390
+  (1.6ms) COMMIT
391
+  (1.9ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
392
+  (0.3ms) BEGIN
393
+ ----------------------------------------------------------------------------
394
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
395
+ ----------------------------------------------------------------------------
396
+ Parent Load (0.6ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
397
+  (0.5ms) SELECT COUNT(*) FROM "parents"
398
+  (0.3ms) SAVEPOINT active_record_1
399
+ SQL (1.2ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
400
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
401
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
402
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
403
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
404
+  (0.3ms) ROLLBACK
405
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
406
+  (2.9ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
407
+  (0.2ms) BEGIN
408
+ Fixture Delete (0.3ms) DELETE FROM "children"
409
+ Fixture Insert (0.3ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
410
+ Fixture Delete (0.3ms) DELETE FROM "parents"
411
+ Fixture Insert (0.1ms) INSERT INTO "parents" ("id") VALUES (1024804656)
412
+ Fixture Insert (0.2ms) INSERT INTO "parents" ("id") VALUES (1002356086)
413
+  (2.5ms) COMMIT
414
+  (1.9ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
415
+  (0.2ms) BEGIN
416
+ ----------------------------------------------------------------------------
417
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
418
+ ----------------------------------------------------------------------------
419
+ Parent Load (0.3ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
420
+  (0.3ms) SELECT COUNT(*) FROM "parents"
421
+  (0.2ms) SAVEPOINT active_record_1
422
+ SQL (0.6ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
423
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
424
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
425
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
426
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
427
+  (0.2ms) ROLLBACK
428
+ ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
429
+  (3.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
430
+  (0.5ms) BEGIN
431
+ Fixture Delete (0.7ms) DELETE FROM "children"
432
+ Fixture Insert (0.5ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
433
+ Fixture Delete (0.5ms) DELETE FROM "parents"
434
+ Fixture Insert (0.3ms) INSERT INTO "parents" ("id") VALUES (1024804656)
435
+ Fixture Insert (0.3ms) INSERT INTO "parents" ("id") VALUES (1002356086)
436
+  (1.8ms) COMMIT
437
+  (2.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
438
+  (0.5ms) BEGIN
439
+ ----------------------------------------------------------------------------
440
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
441
+ ----------------------------------------------------------------------------
442
+ Parent Load (0.4ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
443
+  (0.3ms) SELECT COUNT(*) FROM "parents"
444
+  (0.2ms) SAVEPOINT active_record_1
445
+ SQL (0.9ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
446
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
447
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
448
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
449
+  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1
450
+  (0.2ms) ROLLBACK
451
+ ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
452
+  (1.9ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
453
+  (0.2ms) BEGIN
454
+ Fixture Delete (0.2ms) DELETE FROM "children"
455
+ Fixture Insert (0.2ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
456
+ Fixture Delete (0.3ms) DELETE FROM "parents"
457
+ Fixture Insert (0.2ms) INSERT INTO "parents" ("id") VALUES (1024804656)
458
+ Fixture Insert (0.2ms) INSERT INTO "parents" ("id") VALUES (1002356086)
459
+  (2.5ms) COMMIT
460
+  (3.5ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
461
+  (0.3ms) BEGIN
462
+ ----------------------------------------------------------------------------
463
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
464
+ ----------------------------------------------------------------------------
465
+ Parent Load (0.4ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
466
+  (0.6ms) SELECT COUNT(*) FROM "parents"
467
+  (0.2ms) SAVEPOINT active_record_1
468
+ SQL (0.9ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
469
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
470
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
471
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
472
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
473
+  (0.1ms) ROLLBACK
474
+ ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
475
+  (2.6ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
476
+  (0.4ms) BEGIN
477
+ Fixture Delete (0.7ms) DELETE FROM "children"
478
+ Fixture Insert (0.5ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
479
+ Fixture Delete (0.7ms) DELETE FROM "parents"
480
+ Fixture Insert (0.6ms) INSERT INTO "parents" ("id") VALUES (1024804656)
481
+ Fixture Insert (0.5ms) INSERT INTO "parents" ("id") VALUES (1002356086)
482
+  (3.3ms) COMMIT
483
+  (3.0ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
484
+  (0.3ms) BEGIN
485
+ ----------------------------------------------------------------------------
486
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
487
+ ----------------------------------------------------------------------------
488
+ Parent Load (0.6ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
489
+  (0.5ms) SELECT COUNT(*) FROM "parents"
490
+  (0.3ms) SAVEPOINT active_record_1
491
+ SQL (1.3ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
492
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
493
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
494
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
495
+  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1
496
+  (0.5ms) SELECT COUNT(*) FROM "parents"
497
+  (0.3ms) ROLLBACK
498
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
499
+  (3.2ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
500
+  (0.2ms) BEGIN
501
+ Fixture Delete (0.3ms) DELETE FROM "children"
502
+ Fixture Insert (0.3ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
503
+ Fixture Delete (0.3ms) DELETE FROM "parents"
504
+ Fixture Insert (0.2ms) INSERT INTO "parents" ("id") VALUES (1024804656)
505
+ Fixture Insert (0.1ms) INSERT INTO "parents" ("id") VALUES (1002356086)
506
+  (2.8ms) COMMIT
507
+  (2.6ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
508
+  (0.1ms) BEGIN
509
+ ----------------------------------------------------------------------------
510
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
511
+ ----------------------------------------------------------------------------
512
+ Parent Load (0.3ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
513
+  (0.3ms) SELECT COUNT(*) FROM "parents"
514
+  (0.1ms) SAVEPOINT active_record_1
515
+ SQL (0.7ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
516
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
517
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
518
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
519
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
520
+  (0.4ms) SELECT COUNT(*) FROM "parents"
521
+  (0.2ms) ROLLBACK
522
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
523
+  (3.7ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
524
+  (0.5ms) BEGIN
525
+ Fixture Delete (0.7ms) DELETE FROM "children"
526
+ Fixture Insert (0.6ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
527
+ Fixture Delete (0.8ms) DELETE FROM "parents"
528
+ Fixture Insert (0.6ms) INSERT INTO "parents" ("id") VALUES (1024804656)
529
+ Fixture Insert (0.5ms) INSERT INTO "parents" ("id") VALUES (1002356086)
530
+  (2.8ms) COMMIT
531
+  (3.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
532
+  (0.3ms) BEGIN
533
+ ----------------------------------------------------------------------------
534
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
535
+ ----------------------------------------------------------------------------
536
+ Parent Load (0.5ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
537
+  (0.4ms) SELECT COUNT(*) FROM "parents"
538
+  (0.3ms) SAVEPOINT active_record_1
539
+ SQL (1.2ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
540
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
541
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
542
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
543
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
544
+  (0.5ms) SELECT COUNT(*) FROM "parents"
545
+  (0.3ms) ROLLBACK
546
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
547
+  (4.0ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
548
+  (0.3ms) BEGIN
549
+ Fixture Delete (0.6ms) DELETE FROM "children"
550
+ Fixture Insert (0.5ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
551
+ Fixture Delete (0.8ms) DELETE FROM "parents"
552
+ Fixture Insert (0.5ms) INSERT INTO "parents" ("id") VALUES (1024804656)
553
+ Fixture Insert (0.5ms) INSERT INTO "parents" ("id") VALUES (1002356086)
554
+  (2.7ms) COMMIT
555
+  (2.0ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
556
+  (0.3ms) BEGIN
557
+ ----------------------------------------------------------------------------
558
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
559
+ ----------------------------------------------------------------------------
560
+ Parent Load (0.4ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
561
+  (0.4ms) SELECT COUNT(*) FROM "parents"
562
+  (0.2ms) SAVEPOINT active_record_1
563
+ SQL (1.1ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
564
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
565
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
566
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
567
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
568
+  (0.5ms) SELECT COUNT(*) FROM "parents"
569
+  (0.4ms) ROLLBACK
570
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
571
+  (2.9ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
572
+  (0.2ms) BEGIN
573
+ Fixture Delete (0.3ms) DELETE FROM "children"
574
+ Fixture Insert (0.3ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
575
+ Fixture Delete (0.2ms) DELETE FROM "parents"
576
+ Fixture Insert (0.1ms) INSERT INTO "parents" ("id") VALUES (1024804656)
577
+ Fixture Insert (0.1ms) INSERT INTO "parents" ("id") VALUES (1002356086)
578
+  (1.4ms) COMMIT
579
+  (3.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
580
+  (0.2ms) BEGIN
581
+ ----------------------------------------------------------------------------
582
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
583
+ ----------------------------------------------------------------------------
584
+ Parent Load (0.3ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
585
+  (0.3ms) SELECT COUNT(*) FROM "parents"
586
+  (0.2ms) SAVEPOINT active_record_1
587
+ SQL (1.2ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
588
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
589
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
590
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
591
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
592
+  (0.4ms) SELECT COUNT(*) FROM "parents"
593
+  (0.2ms) ROLLBACK
594
+ ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
595
+  (2.9ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
596
+  (0.2ms) BEGIN
597
+ Fixture Delete (0.2ms) DELETE FROM "children"
598
+ Fixture Insert (0.2ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
599
+ Fixture Delete (0.2ms) DELETE FROM "parents"
600
+ Fixture Insert (0.1ms) INSERT INTO "parents" ("id") VALUES (1024804656)
601
+ Fixture Insert (0.1ms) INSERT INTO "parents" ("id") VALUES (1002356086)
602
+  (2.8ms) COMMIT
603
+  (3.6ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
604
+  (0.3ms) BEGIN
605
+ ----------------------------------------------------------------------------
606
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
607
+ ----------------------------------------------------------------------------
608
+ Parent Load (0.3ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
609
+  (0.2ms) SELECT COUNT(*) FROM "parents"
610
+  (0.2ms) SAVEPOINT active_record_1
611
+ SQL (0.6ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
612
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
613
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
614
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
615
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
616
+  (0.4ms) SELECT COUNT(*) FROM "parents"
617
+  (0.1ms) ROLLBACK
618
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
619
+  (2.7ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
620
+  (0.2ms) BEGIN
621
+ Fixture Delete (0.3ms) DELETE FROM "children"
622
+ Fixture Insert (0.2ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
623
+ Fixture Delete (0.3ms) DELETE FROM "parents"
624
+ Fixture Insert (0.2ms) INSERT INTO "parents" ("id") VALUES (1024804656)
625
+ Fixture Insert (0.2ms) INSERT INTO "parents" ("id") VALUES (1002356086)
626
+  (1.5ms) COMMIT
627
+  (2.9ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
628
+  (0.1ms) BEGIN
629
+ ----------------------------------------------------------------------------
630
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
631
+ ----------------------------------------------------------------------------
632
+ Parent Load (0.2ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
633
+  (0.2ms) SELECT COUNT(*) FROM "parents"
634
+  (0.1ms) SAVEPOINT active_record_1
635
+ SQL (0.6ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
636
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
637
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
638
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
639
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
640
+  (0.3ms) SELECT COUNT(*) FROM "parents"
641
+  (0.1ms) ROLLBACK
642
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
643
+  (2.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
644
+  (0.4ms) BEGIN
645
+ Fixture Delete (0.6ms) DELETE FROM "children"
646
+ Fixture Insert (0.5ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
647
+ Fixture Delete (0.8ms) DELETE FROM "parents"
648
+ Fixture Insert (0.4ms) INSERT INTO "parents" ("id") VALUES (1024804656)
649
+ Fixture Insert (0.4ms) INSERT INTO "parents" ("id") VALUES (1002356086)
650
+  (3.2ms) COMMIT
651
+  (1.9ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
652
+  (0.3ms) BEGIN
653
+ ----------------------------------------------------------------------------
654
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
655
+ ----------------------------------------------------------------------------
656
+ Parent Load (0.4ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
657
+  (0.4ms) SELECT COUNT(*) FROM "parents"
658
+  (0.2ms) SAVEPOINT active_record_1
659
+ SQL (1.0ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
660
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
661
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
662
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
663
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
664
+  (0.4ms) SELECT COUNT(*) FROM "parents"
665
+  (0.3ms) ROLLBACK
666
+ ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
667
+  (2.0ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
668
+  (0.2ms) BEGIN
669
+ Fixture Delete (0.3ms) DELETE FROM "children"
670
+ Fixture Insert (0.3ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
671
+ Fixture Delete (0.3ms) DELETE FROM "parents"
672
+ Fixture Insert (0.2ms) INSERT INTO "parents" ("id") VALUES (1024804656)
673
+ Fixture Insert (0.2ms) INSERT INTO "parents" ("id") VALUES (1002356086)
674
+  (1.6ms) COMMIT
675
+  (2.1ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
676
+  (0.8ms) BEGIN
677
+ ----------------------------------------------------------------------------
678
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
679
+ ----------------------------------------------------------------------------
680
+ Parent Load (0.2ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
681
+  (0.2ms) SELECT COUNT(*) FROM "parents"
682
+  (0.1ms) SAVEPOINT active_record_1
683
+ SQL (0.6ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
684
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
685
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
686
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
687
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
688
+  (0.4ms) SELECT COUNT(*) FROM "parents"
689
+  (0.1ms) ROLLBACK
690
+ ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
691
+  (2.7ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
692
+  (0.4ms) BEGIN
693
+ Fixture Delete (0.6ms) DELETE FROM "children"
694
+ Fixture Insert (0.5ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
695
+ Fixture Delete (0.7ms) DELETE FROM "parents"
696
+ Fixture Insert (0.5ms) INSERT INTO "parents" ("id") VALUES (1024804656)
697
+ Fixture Insert (0.4ms) INSERT INTO "parents" ("id") VALUES (1002356086)
698
+  (3.1ms) COMMIT
699
+  (2.0ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
700
+  (0.3ms) BEGIN
701
+ ----------------------------------------------------------------------------
702
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
703
+ ----------------------------------------------------------------------------
704
+ Parent Load (0.6ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
705
+  (0.5ms) SELECT COUNT(*) FROM "parents"
706
+  (0.3ms) SAVEPOINT active_record_1
707
+ SQL (1.3ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
708
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
709
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
710
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
711
+  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1
712
+  (0.5ms) SELECT COUNT(*) FROM "parents"
713
+  (0.3ms) ROLLBACK
714
+ ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
715
+  (3.8ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
716
+  (0.4ms) BEGIN
717
+ Fixture Delete (0.6ms) DELETE FROM "children"
718
+ Fixture Insert (0.6ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
719
+ Fixture Delete (0.7ms) DELETE FROM "parents"
720
+ Fixture Insert (0.5ms) INSERT INTO "parents" ("id") VALUES (1024804656)
721
+ Fixture Insert (0.5ms) INSERT INTO "parents" ("id") VALUES (1002356086)
722
+  (3.2ms) COMMIT
723
+  (3.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
724
+  (0.3ms) BEGIN
725
+ ----------------------------------------------------------------------------
726
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
727
+ ----------------------------------------------------------------------------
728
+ Parent Load (0.5ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
729
+  (0.4ms) SELECT COUNT(*) FROM "parents"
730
+  (0.2ms) SAVEPOINT active_record_1
731
+ SQL (1.1ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
732
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
733
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
734
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
735
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
736
+  (0.4ms) SELECT COUNT(*) FROM "parents"
737
+  (0.2ms) ROLLBACK
738
+ ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
739
+  (3.7ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
740
+  (0.4ms) BEGIN
741
+ Fixture Delete (0.7ms) DELETE FROM "children"
742
+ Fixture Insert (0.6ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
743
+ Fixture Delete (0.8ms) DELETE FROM "parents"
744
+ Fixture Insert (0.5ms) INSERT INTO "parents" ("id") VALUES (1024804656)
745
+ Fixture Insert (0.5ms) INSERT INTO "parents" ("id") VALUES (1002356086)
746
+  (3.2ms) COMMIT
747
+  (3.1ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
748
+  (0.4ms) BEGIN
749
+ ----------------------------------------------------------------------------
750
+ UnconstrainedTest: test_foreign_key_constraint_converted_to_validation_error
751
+ ----------------------------------------------------------------------------
752
+ Parent Load (0.6ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
753
+  (0.5ms) SELECT COUNT(*) FROM "parents"
754
+  (0.3ms) SAVEPOINT active_record_1
755
+ SQL (1.3ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
756
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
757
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
758
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
759
+  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1
760
+  (0.5ms) SELECT COUNT(*) FROM "parents"
761
+  (0.3ms) ROLLBACK
762
+ ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
763
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
764
+  (1.8ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
765
+  (0.3ms) BEGIN
766
+ Fixture Delete (0.3ms) DELETE FROM "children"
767
+ Fixture Insert (0.2ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
768
+ Fixture Delete (0.3ms) DELETE FROM "parents"
769
+ Fixture Insert (0.2ms) INSERT INTO "parents" ("id") VALUES (1024804656)
770
+ Fixture Insert (0.2ms) INSERT INTO "parents" ("id") VALUES (1002356086)
771
+  (1.8ms) COMMIT
772
+  (2.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
773
+  (0.3ms) BEGIN
774
+ ----------------------------------------------------------
775
+ DestroyTest: test_destroyed_without_foreign_key_constraint
776
+ ----------------------------------------------------------
777
+  (0.2ms) ROLLBACK
778
+  (0.2ms) BEGIN
779
+ ----------------------------------------------------------------------
780
+ DestroyTest: test_foreign_key_constraint_converted_to_validation_error
781
+ ----------------------------------------------------------------------
782
+ Parent Load (0.2ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
783
+  (0.2ms) SELECT COUNT(*) FROM "parents"
784
+  (0.1ms) SAVEPOINT active_record_1
785
+ SQL (0.6ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
786
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
787
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
788
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
789
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
790
+  (0.3ms) SELECT COUNT(*) FROM "parents"
791
+  (0.1ms) ROLLBACK
792
+ ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
793
+  (2.7ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
794
+  (0.3ms) BEGIN
795
+ Fixture Delete (0.5ms) DELETE FROM "children"
796
+ Fixture Insert (0.4ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
797
+ Fixture Delete (0.4ms) DELETE FROM "parents"
798
+ Fixture Insert (0.5ms) INSERT INTO "parents" ("id") VALUES (1024804656)
799
+ Fixture Insert (0.4ms) INSERT INTO "parents" ("id") VALUES (1002356086)
800
+  (1.8ms) COMMIT
801
+  (3.1ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
802
+  (0.3ms) BEGIN
803
+ ----------------------------------------------------------------------
804
+ DestroyTest: test_foreign_key_constraint_converted_to_validation_error
805
+ ----------------------------------------------------------------------
806
+ Parent Load (0.5ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
807
+  (0.4ms) SELECT COUNT(*) FROM "parents"
808
+  (0.3ms) SAVEPOINT active_record_1
809
+ SQL (1.4ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
810
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
811
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
812
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
813
+  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1
814
+  (0.5ms) SELECT COUNT(*) FROM "parents"
815
+  (0.3ms) ROLLBACK
816
+  (0.3ms) BEGIN
817
+ ----------------------------------------------------------
818
+ DestroyTest: test_destroyed_without_foreign_key_constraint
819
+ ----------------------------------------------------------
820
+ Parent Load (0.4ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1002356086]]
821
+  (0.5ms) SELECT COUNT(*) FROM "parents"
822
+  (0.3ms) SAVEPOINT active_record_1
823
+ SQL (0.7ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1002356086]]
824
+  (0.3ms) RELEASE SAVEPOINT active_record_1
825
+  (0.4ms) SELECT COUNT(*) FROM "parents"
826
+  (0.2ms) ROLLBACK
827
+ ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
828
+  (2.6ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
829
+  (0.3ms) BEGIN
830
+ Fixture Delete (0.6ms) DELETE FROM "children"
831
+ Fixture Insert (0.4ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
832
+ Fixture Delete (0.6ms) DELETE FROM "parents"
833
+ Fixture Insert (0.3ms) INSERT INTO "parents" ("id") VALUES (1024804656)
834
+ Fixture Insert (0.3ms) INSERT INTO "parents" ("id") VALUES (1002356086)
835
+  (1.7ms) COMMIT
836
+  (2.8ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
837
+  (0.2ms) BEGIN
838
+ ----------------------------------------------------------------------
839
+ DestroyTest: test_foreign_key_constraint_converted_to_validation_error
840
+ ----------------------------------------------------------------------
841
+ Parent Load (0.4ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
842
+  (0.7ms) SELECT COUNT(*) FROM "parents"
843
+  (0.3ms) SAVEPOINT active_record_1
844
+ SQL (0.8ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
845
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
846
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
847
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
848
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
849
+  (0.5ms) SELECT COUNT(*) FROM "parents"
850
+  (0.3ms) ROLLBACK
851
+  (0.2ms) BEGIN
852
+ ----------------------------------------------------------
853
+ DestroyTest: test_destroyed_without_foreign_key_constraint
854
+ ----------------------------------------------------------
855
+ Parent Load (0.4ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1002356086]]
856
+  (0.4ms) SELECT COUNT(*) FROM "parents"
857
+  (0.3ms) SAVEPOINT active_record_1
858
+ SQL (0.6ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1002356086]]
859
+  (0.2ms) RELEASE SAVEPOINT active_record_1
860
+  (0.3ms) SELECT COUNT(*) FROM "parents"
861
+  (0.3ms) ROLLBACK
862
+ ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
863
+  (3.9ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
864
+  (0.4ms) BEGIN
865
+ Fixture Delete (0.6ms) DELETE FROM "children"
866
+ Fixture Insert (0.6ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
867
+ Fixture Delete (0.6ms) DELETE FROM "parents"
868
+ Fixture Insert (0.4ms) INSERT INTO "parents" ("id") VALUES (1024804656)
869
+ Fixture Insert (0.3ms) INSERT INTO "parents" ("id") VALUES (1002356086)
870
+  (2.9ms) COMMIT
871
+  (3.5ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
872
+  (0.4ms) BEGIN
873
+ ----------------------------------------------------------
874
+ DestroyTest: test_destroyed_without_foreign_key_constraint
875
+ ----------------------------------------------------------
876
+ Parent Load (0.4ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1002356086]]
877
+  (0.4ms) SELECT COUNT(*) FROM "parents"
878
+  (0.3ms) SAVEPOINT active_record_1
879
+ SQL (0.8ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1002356086]]
880
+  (0.4ms) RELEASE SAVEPOINT active_record_1
881
+  (0.5ms) SELECT COUNT(*) FROM "parents"
882
+  (0.3ms) ROLLBACK
883
+  (0.3ms) BEGIN
884
+ ----------------------------------------------------------------------
885
+ DestroyTest: test_foreign_key_constraint_converted_to_validation_error
886
+ ----------------------------------------------------------------------
887
+ Parent Load (0.4ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
888
+  (0.4ms) SELECT COUNT(*) FROM "parents"
889
+  (0.3ms) SAVEPOINT active_record_1
890
+ SQL (1.0ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
891
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
892
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
893
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
894
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
895
+  (0.6ms) SELECT COUNT(*) FROM "parents"
896
+  (0.3ms) ROLLBACK
897
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
898
+  (3.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
899
+  (0.3ms) BEGIN
900
+ Fixture Delete (0.3ms) DELETE FROM "children"
901
+ Fixture Insert (0.3ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
902
+ Fixture Delete (0.3ms) DELETE FROM "parents"
903
+ Fixture Insert (0.2ms) INSERT INTO "parents" ("id") VALUES (1024804656)
904
+ Fixture Insert (0.1ms) INSERT INTO "parents" ("id") VALUES (1002356086)
905
+  (1.5ms) COMMIT
906
+  (3.5ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
907
+  (0.2ms) BEGIN
908
+ ----------------------------------------------------------
909
+ DestroyTest: test_destroyed_without_foreign_key_constraint
910
+ ----------------------------------------------------------
911
+ Parent Load (0.2ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1002356086]]
912
+  (0.2ms) SELECT COUNT(*) FROM "parents"
913
+  (0.1ms) SAVEPOINT active_record_1
914
+ SQL (0.5ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1002356086]]
915
+  (0.1ms) RELEASE SAVEPOINT active_record_1
916
+  (0.2ms) SELECT COUNT(*) FROM "parents"
917
+  (0.2ms) ROLLBACK
918
+  (0.1ms) BEGIN
919
+ ----------------------------------------------------------------------
920
+ DestroyTest: test_foreign_key_constraint_converted_to_validation_error
921
+ ----------------------------------------------------------------------
922
+ Parent Load (0.2ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
923
+  (0.2ms) SELECT COUNT(*) FROM "parents"
924
+  (0.1ms) SAVEPOINT active_record_1
925
+ SQL (0.7ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
926
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
927
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
928
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
929
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
930
+  (0.6ms) SELECT COUNT(*) FROM "parents"
931
+  (0.2ms) ROLLBACK
932
+ ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
933
+  (4.1ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
934
+  (0.4ms) BEGIN
935
+ Fixture Delete (0.6ms) DELETE FROM "children"
936
+ Fixture Insert (0.5ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
937
+ Fixture Delete (0.9ms) DELETE FROM "parents"
938
+ Fixture Insert (0.6ms) INSERT INTO "parents" ("id") VALUES (1024804656)
939
+ Fixture Insert (0.4ms) INSERT INTO "parents" ("id") VALUES (1002356086)
940
+  (2.7ms) COMMIT
941
+  (3.0ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
942
+  (0.3ms) BEGIN
943
+ -------------------------------------------------------------------
944
+ SaveTest: test_foreign_key_constraint_converted_to_validation_error
945
+ -------------------------------------------------------------------
946
+ Child Load (0.5ms) SELECT "children".* FROM "children" WHERE "children"."id" = $1 LIMIT 1 [["id", 980190962]]
947
+  (0.3ms) SAVEPOINT active_record_1
948
+ SQL (0.9ms) UPDATE "children" SET "parent_id" = $1 WHERE "children"."id" = $2 [["parent_id", -1], ["id", 980190962]]
949
+ PG::ForeignKeyViolation: ERROR: insert or update on table "children" violates foreign key constraint "fk_rails_2d768a42d4"
950
+ DETAIL: Key (parent_id)=(-1) is not present in table "parents".
951
+ : UPDATE "children" SET "parent_id" = $1 WHERE "children"."id" = $2
952
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
953
+  (0.2ms) ROLLBACK
954
+  (0.2ms) BEGIN
955
+ ----------------------------------------------------------
956
+ DestroyTest: test_destroyed_without_foreign_key_constraint
957
+ ----------------------------------------------------------
958
+ Parent Load (0.3ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1002356086]]
959
+  (0.5ms) SELECT COUNT(*) FROM "parents"
960
+  (0.2ms) SAVEPOINT active_record_1
961
+ SQL (0.9ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1002356086]]
962
+  (0.3ms) RELEASE SAVEPOINT active_record_1
963
+  (0.4ms) SELECT COUNT(*) FROM "parents"
964
+  (0.3ms) ROLLBACK
965
+  (0.3ms) BEGIN
966
+ ----------------------------------------------------------------------
967
+ DestroyTest: test_foreign_key_constraint_converted_to_validation_error
968
+ ----------------------------------------------------------------------
969
+ Parent Load (0.4ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
970
+  (0.4ms) SELECT COUNT(*) FROM "parents"
971
+  (0.2ms) SAVEPOINT active_record_1
972
+ SQL (0.8ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
973
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
974
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
975
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
976
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
977
+  (0.4ms) SELECT COUNT(*) FROM "parents"
978
+  (0.3ms) ROLLBACK
979
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
980
+  (3.8ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
981
+  (0.4ms) BEGIN
982
+ Fixture Delete (0.4ms) DELETE FROM "children"
983
+ Fixture Insert (0.5ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
984
+ Fixture Delete (0.7ms) DELETE FROM "parents"
985
+ Fixture Insert (0.5ms) INSERT INTO "parents" ("id") VALUES (1024804656)
986
+ Fixture Insert (0.4ms) INSERT INTO "parents" ("id") VALUES (1002356086)
987
+  (1.8ms) COMMIT
988
+  (3.5ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
989
+  (0.3ms) BEGIN
990
+ -------------------------------------------------------------------
991
+ SaveTest: test_foreign_key_constraint_converted_to_validation_error
992
+ -------------------------------------------------------------------
993
+ Child Load (0.5ms) SELECT "children".* FROM "children" WHERE "children"."id" = $1 LIMIT 1 [["id", 980190962]]
994
+  (0.2ms) SAVEPOINT active_record_1
995
+ SQL (1.2ms) UPDATE "children" SET "parent_id" = $1 WHERE "children"."id" = $2 [["parent_id", -1], ["id", 980190962]]
996
+ PG::ForeignKeyViolation: ERROR: insert or update on table "children" violates foreign key constraint "fk_rails_2d768a42d4"
997
+ DETAIL: Key (parent_id)=(-1) is not present in table "parents".
998
+ : UPDATE "children" SET "parent_id" = $1 WHERE "children"."id" = $2
999
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
1000
+  (0.2ms) ROLLBACK
1001
+  (0.3ms) BEGIN
1002
+ ----------------------------------------------------------------------
1003
+ DestroyTest: test_foreign_key_constraint_converted_to_validation_error
1004
+ ----------------------------------------------------------------------
1005
+ Parent Load (0.5ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
1006
+  (0.7ms) SELECT COUNT(*) FROM "parents"
1007
+  (0.3ms) SAVEPOINT active_record_1
1008
+ SQL (1.1ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
1009
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
1010
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
1011
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
1012
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
1013
+  (0.3ms) ROLLBACK
1014
+  (0.3ms) BEGIN
1015
+ ----------------------------------------------------------
1016
+ DestroyTest: test_destroyed_without_foreign_key_constraint
1017
+ ----------------------------------------------------------
1018
+ Parent Load (0.5ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1002356086]]
1019
+  (0.5ms) SELECT COUNT(*) FROM "parents"
1020
+  (0.3ms) SAVEPOINT active_record_1
1021
+ SQL (0.6ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1002356086]]
1022
+  (0.2ms) RELEASE SAVEPOINT active_record_1
1023
+  (0.5ms) SELECT COUNT(*) FROM "parents"
1024
+  (0.3ms) ROLLBACK
1025
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
1026
+  (2.7ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
1027
+  (0.4ms) BEGIN
1028
+ Fixture Delete (0.6ms) DELETE FROM "children"
1029
+ Fixture Insert (0.5ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
1030
+ Fixture Delete (0.7ms) DELETE FROM "parents"
1031
+ Fixture Insert (0.5ms) INSERT INTO "parents" ("id") VALUES (1024804656)
1032
+ Fixture Insert (0.5ms) INSERT INTO "parents" ("id") VALUES (1002356086)
1033
+  (3.3ms) COMMIT
1034
+  (3.0ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
1035
+  (0.3ms) BEGIN
1036
+ -------------------------------------------------------------------
1037
+ SaveTest: test_foreign_key_constraint_converted_to_validation_error
1038
+ -------------------------------------------------------------------
1039
+ Child Load (0.6ms) SELECT "children".* FROM "children" WHERE "children"."id" = $1 LIMIT 1 [["id", 980190962]]
1040
+  (0.4ms) SAVEPOINT active_record_1
1041
+ SQL (1.1ms) UPDATE "children" SET "parent_id" = $1 WHERE "children"."id" = $2 [["parent_id", -1], ["id", 980190962]]
1042
+ PG::ForeignKeyViolation: ERROR: insert or update on table "children" violates foreign key constraint "fk_rails_2d768a42d4"
1043
+ DETAIL: Key (parent_id)=(-1) is not present in table "parents".
1044
+ : UPDATE "children" SET "parent_id" = $1 WHERE "children"."id" = $2
1045
+  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1
1046
+  (0.3ms) ROLLBACK
1047
+  (0.3ms) BEGIN
1048
+ ----------------------------------------------------------
1049
+ DestroyTest: test_destroyed_without_foreign_key_constraint
1050
+ ----------------------------------------------------------
1051
+ Parent Load (0.4ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1002356086]]
1052
+  (0.5ms) SELECT COUNT(*) FROM "parents"
1053
+  (0.3ms) SAVEPOINT active_record_1
1054
+ SQL (0.9ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1002356086]]
1055
+  (0.3ms) RELEASE SAVEPOINT active_record_1
1056
+  (0.5ms) SELECT COUNT(*) FROM "parents"
1057
+  (0.3ms) ROLLBACK
1058
+  (0.3ms) BEGIN
1059
+ ----------------------------------------------------------------------
1060
+ DestroyTest: test_foreign_key_constraint_converted_to_validation_error
1061
+ ----------------------------------------------------------------------
1062
+ Parent Load (0.4ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
1063
+  (0.4ms) SELECT COUNT(*) FROM "parents"
1064
+  (0.2ms) SAVEPOINT active_record_1
1065
+ SQL (0.8ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
1066
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
1067
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
1068
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
1069
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
1070
+  (0.6ms) SELECT COUNT(*) FROM "parents"
1071
+  (0.4ms) ROLLBACK
1072
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
1073
+  (3.7ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
1074
+  (0.3ms) BEGIN
1075
+ Fixture Delete (0.6ms) DELETE FROM "children"
1076
+ Fixture Insert (0.5ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
1077
+ Fixture Delete (0.3ms) DELETE FROM "parents"
1078
+ Fixture Insert (0.4ms) INSERT INTO "parents" ("id") VALUES (1024804656)
1079
+ Fixture Insert (0.4ms) INSERT INTO "parents" ("id") VALUES (1002356086)
1080
+  (1.9ms) COMMIT
1081
+  (3.5ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
1082
+  (0.3ms) BEGIN
1083
+ ----------------------------------------------------------
1084
+ DestroyTest: test_destroyed_without_foreign_key_constraint
1085
+ ----------------------------------------------------------
1086
+ Parent Load (0.5ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1002356086]]
1087
+  (0.5ms) SELECT COUNT(*) FROM "parents"
1088
+  (0.3ms) SAVEPOINT active_record_1
1089
+ SQL (0.9ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1002356086]]
1090
+  (0.2ms) RELEASE SAVEPOINT active_record_1
1091
+  (0.4ms) SELECT COUNT(*) FROM "parents"
1092
+  (0.3ms) ROLLBACK
1093
+  (0.2ms) BEGIN
1094
+ ----------------------------------------------------------------------
1095
+ DestroyTest: test_foreign_key_constraint_converted_to_validation_error
1096
+ ----------------------------------------------------------------------
1097
+ Parent Load (0.4ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
1098
+  (0.4ms) SELECT COUNT(*) FROM "parents"
1099
+  (0.3ms) SAVEPOINT active_record_1
1100
+ SQL (0.9ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
1101
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
1102
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
1103
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
1104
+  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1
1105
+  (0.7ms) SELECT COUNT(*) FROM "parents"
1106
+  (0.3ms) ROLLBACK
1107
+  (0.3ms) BEGIN
1108
+ -------------------------------------------------------------------
1109
+ SaveTest: test_foreign_key_constraint_converted_to_validation_error
1110
+ -------------------------------------------------------------------
1111
+ Child Load (0.4ms) SELECT "children".* FROM "children" WHERE "children"."id" = $1 LIMIT 1 [["id", 980190962]]
1112
+  (0.3ms) SAVEPOINT active_record_1
1113
+ SQL (1.0ms) UPDATE "children" SET "parent_id" = $1 WHERE "children"."id" = $2 [["parent_id", -1], ["id", 980190962]]
1114
+ PG::ForeignKeyViolation: ERROR: insert or update on table "children" violates foreign key constraint "fk_rails_2d768a42d4"
1115
+ DETAIL: Key (parent_id)=(-1) is not present in table "parents".
1116
+ : UPDATE "children" SET "parent_id" = $1 WHERE "children"."id" = $2
1117
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
1118
+  (0.3ms) ROLLBACK
1119
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1120
+  (4.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
1121
+  (0.4ms) BEGIN
1122
+ Fixture Delete (0.6ms) DELETE FROM "children"
1123
+ Fixture Insert (0.3ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
1124
+ Fixture Delete (0.8ms) DELETE FROM "parents"
1125
+ Fixture Insert (0.6ms) INSERT INTO "parents" ("id") VALUES (1024804656)
1126
+ Fixture Insert (0.4ms) INSERT INTO "parents" ("id") VALUES (1002356086)
1127
+  (1.8ms) COMMIT
1128
+  (3.5ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
1129
+  (0.3ms) BEGIN
1130
+ -------------------------------------------------------------------
1131
+ SaveTest: test_foreign_key_constraint_converted_to_validation_error
1132
+ -------------------------------------------------------------------
1133
+ Child Load (0.5ms) SELECT "children".* FROM "children" WHERE "children"."id" = $1 LIMIT 1 [["id", 980190962]]
1134
+  (0.3ms) SAVEPOINT active_record_1
1135
+ SQL (1.4ms) UPDATE "children" SET "parent_id" = $1 WHERE "children"."id" = $2 [["parent_id", -1], ["id", 980190962]]
1136
+ PG::ForeignKeyViolation: ERROR: insert or update on table "children" violates foreign key constraint "fk_rails_2d768a42d4"
1137
+ DETAIL: Key (parent_id)=(-1) is not present in table "parents".
1138
+ : UPDATE "children" SET "parent_id" = $1 WHERE "children"."id" = $2
1139
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
1140
+  (0.3ms) ROLLBACK
1141
+  (0.2ms) BEGIN
1142
+ ----------------------------------------------------------
1143
+ DestroyTest: test_destroyed_without_foreign_key_constraint
1144
+ ----------------------------------------------------------
1145
+ Parent Load (0.3ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1002356086]]
1146
+  (0.3ms) SELECT COUNT(*) FROM "parents"
1147
+  (0.2ms) SAVEPOINT active_record_1
1148
+ SQL (0.5ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1002356086]]
1149
+  (0.2ms) RELEASE SAVEPOINT active_record_1
1150
+  (0.3ms) SELECT COUNT(*) FROM "parents"
1151
+  (0.2ms) ROLLBACK
1152
+  (0.2ms) BEGIN
1153
+ ----------------------------------------------------------------------
1154
+ DestroyTest: test_foreign_key_constraint_converted_to_validation_error
1155
+ ----------------------------------------------------------------------
1156
+ Parent Load (0.2ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
1157
+  (0.2ms) SELECT COUNT(*) FROM "parents"
1158
+  (0.1ms) SAVEPOINT active_record_1
1159
+ SQL (0.4ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
1160
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
1161
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
1162
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
1163
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
1164
+  (0.2ms) SELECT COUNT(*) FROM "parents"
1165
+  (0.2ms) ROLLBACK
1166
+ ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
1167
+  (2.1ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
1168
+  (0.2ms) BEGIN
1169
+ Fixture Delete (0.3ms) DELETE FROM "children"
1170
+ Fixture Insert (0.2ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
1171
+ Fixture Delete (0.3ms) DELETE FROM "parents"
1172
+ Fixture Insert (0.2ms) INSERT INTO "parents" ("id") VALUES (1024804656)
1173
+ Fixture Insert (0.2ms) INSERT INTO "parents" ("id") VALUES (1002356086)
1174
+  (7.0ms) COMMIT
1175
+  (1.7ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
1176
+  (0.1ms) BEGIN
1177
+ ----------------------------------------------------------
1178
+ DestroyTest: test_destroyed_without_foreign_key_constraint
1179
+ ----------------------------------------------------------
1180
+ Parent Load (0.3ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1002356086]]
1181
+  (0.2ms) SELECT COUNT(*) FROM "parents"
1182
+  (0.1ms) SAVEPOINT active_record_1
1183
+ SQL (0.6ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1002356086]]
1184
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1185
+  (0.2ms) SELECT COUNT(*) FROM "parents"
1186
+  (0.2ms) ROLLBACK
1187
+  (0.2ms) BEGIN
1188
+ ----------------------------------------------------------------------
1189
+ DestroyTest: test_foreign_key_constraint_converted_to_validation_error
1190
+ ----------------------------------------------------------------------
1191
+ Parent Load (0.3ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
1192
+  (0.3ms) SELECT COUNT(*) FROM "parents"
1193
+  (0.2ms) SAVEPOINT active_record_1
1194
+ SQL (0.6ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
1195
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
1196
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
1197
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
1198
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
1199
+  (0.4ms) SELECT COUNT(*) FROM "parents"
1200
+  (0.2ms) ROLLBACK
1201
+  (0.1ms) BEGIN
1202
+ -------------------------------------------------------------------
1203
+ SaveTest: test_foreign_key_constraint_converted_to_validation_error
1204
+ -------------------------------------------------------------------
1205
+ Child Load (0.3ms) SELECT "children".* FROM "children" WHERE "children"."id" = $1 LIMIT 1 [["id", 980190962]]
1206
+  (0.2ms) SAVEPOINT active_record_1
1207
+ SQL (0.7ms) UPDATE "children" SET "parent_id" = $1 WHERE "children"."id" = $2 [["parent_id", 221917195], ["id", 980190962]]
1208
+ PG::ForeignKeyViolation: ERROR: insert or update on table "children" violates foreign key constraint "fk_rails_2d768a42d4"
1209
+ DETAIL: Key (parent_id)=(221917195) is not present in table "parents".
1210
+ : UPDATE "children" SET "parent_id" = $1 WHERE "children"."id" = $2
1211
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
1212
+  (0.2ms) ROLLBACK
1213
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1214
+  (4.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "parents" DISABLE TRIGGER ALL;ALTER TABLE "children" DISABLE TRIGGER ALL
1215
+  (0.2ms) BEGIN
1216
+ Fixture Delete (0.2ms) DELETE FROM "children"
1217
+ Fixture Insert (0.2ms) INSERT INTO "children" ("id", "parent_id") VALUES (980190962, 1024804656)
1218
+ Fixture Delete (0.2ms) DELETE FROM "parents"
1219
+ Fixture Insert (0.2ms) INSERT INTO "parents" ("id") VALUES (1024804656)
1220
+ Fixture Insert (0.1ms) INSERT INTO "parents" ("id") VALUES (1002356086)
1221
+  (1.5ms) COMMIT
1222
+  (2.8ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "parents" ENABLE TRIGGER ALL;ALTER TABLE "children" ENABLE TRIGGER ALL
1223
+  (0.1ms) BEGIN
1224
+ -------------------------------------------------------------------
1225
+ SaveTest: test_foreign_key_constraint_converted_to_validation_error
1226
+ -------------------------------------------------------------------
1227
+ Child Load (0.3ms) SELECT "children".* FROM "children" WHERE "children"."id" = $1 LIMIT 1 [["id", 980190962]]
1228
+  (0.2ms) SAVEPOINT active_record_1
1229
+ SQL (1.1ms) UPDATE "children" SET "parent_id" = $1 WHERE "children"."id" = $2 [["parent_id", 221917195], ["id", 980190962]]
1230
+ PG::ForeignKeyViolation: ERROR: insert or update on table "children" violates foreign key constraint "fk_rails_2d768a42d4"
1231
+ DETAIL: Key (parent_id)=(221917195) is not present in table "parents".
1232
+ : UPDATE "children" SET "parent_id" = $1 WHERE "children"."id" = $2
1233
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
1234
+  (0.2ms) ROLLBACK
1235
+  (0.1ms) BEGIN
1236
+ ----------------------------------------------------------
1237
+ DestroyTest: test_destroyed_without_foreign_key_constraint
1238
+ ----------------------------------------------------------
1239
+ Parent Load (0.2ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1002356086]]
1240
+  (0.4ms) SELECT COUNT(*) FROM "parents"
1241
+  (0.2ms) SAVEPOINT active_record_1
1242
+ SQL (0.4ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1002356086]]
1243
+  (0.2ms) RELEASE SAVEPOINT active_record_1
1244
+  (0.2ms) SELECT COUNT(*) FROM "parents"
1245
+  (0.2ms) ROLLBACK
1246
+  (0.1ms) BEGIN
1247
+ ----------------------------------------------------------------------
1248
+ DestroyTest: test_foreign_key_constraint_converted_to_validation_error
1249
+ ----------------------------------------------------------------------
1250
+ Parent Load (1.2ms) SELECT "parents".* FROM "parents" WHERE "parents"."id" = $1 LIMIT 1 [["id", 1024804656]]
1251
+  (0.4ms) SELECT COUNT(*) FROM "parents"
1252
+  (0.2ms) SAVEPOINT active_record_1
1253
+ SQL (0.7ms) DELETE FROM "parents" WHERE "parents"."id" = $1 [["id", 1024804656]]
1254
+ PG::ForeignKeyViolation: ERROR: update or delete on table "parents" violates foreign key constraint "fk_rails_2d768a42d4" on table "children"
1255
+ DETAIL: Key (id)=(1024804656) is still referenced from table "children".
1256
+ : DELETE FROM "parents" WHERE "parents"."id" = $1
1257
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
1258
+  (0.4ms) SELECT COUNT(*) FROM "parents"
1259
+  (0.1ms) ROLLBACK