enterprise_mti 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 +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +32 -0
- data/lib/enterprise_mti.rb +9 -0
- data/lib/enterprise_mti/class_methods.rb +1 -0
- data/lib/enterprise_mti/class_methods/class_methods.rb +175 -0
- data/lib/enterprise_mti/migration.rb +1 -0
- data/lib/enterprise_mti/migration/migration.rb +34 -0
- data/lib/enterprise_mti/migration/sql_factory.rb +2 -0
- data/lib/enterprise_mti/migration/sql_factory/postgres_sql_factory.rb +16 -0
- data/lib/enterprise_mti/migration/sql_factory/sql_factory.rb +132 -0
- data/lib/enterprise_mti/version.rb +3 -0
- data/lib/tasks/enterprise_mti_tasks.rake +4 -0
- data/spec/class_methods_spec.rb +72 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/container.rb +3 -0
- data/spec/dummy/app/models/superthing.rb +3 -0
- data/spec/dummy/app/models/superthing_subclasses/subthing_one.rb +2 -0
- data/spec/dummy/app/models/superthing_subclasses/subthing_two.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +23 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +23 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +29 -0
- data/spec/dummy/config/environments/production.rb +80 -0
- data/spec/dummy/config/environments/test.rb +36 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +12 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +56 -0
- data/spec/dummy/db/migrate/20131029213145_create_superthings.rb +9 -0
- data/spec/dummy/db/migrate/20131029213154_create_subthing_ones.rb +9 -0
- data/spec/dummy/db/migrate/20131029213203_create_subthing_twos.rb +9 -0
- data/spec/dummy/db/migrate/20131029213251_start_enterprise_mti.rb +9 -0
- data/spec/dummy/db/migrate/20131031131410_create_containers.rb +9 -0
- data/spec/dummy/db/schema.rb +42 -0
- data/spec/dummy/log/development.log +35 -0
- data/spec/dummy/log/test.log +1683 -0
- data/spec/dummy/public/404.html +58 -0
- data/spec/dummy/public/422.html +58 -0
- data/spec/dummy/public/500.html +57 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/spec/models/container_spec.rb +5 -0
- data/spec/dummy/spec/models/subthing_one_spec.rb +5 -0
- data/spec/dummy/spec/models/subthing_two_spec.rb +5 -0
- data/spec/dummy/spec/models/superthing_spec.rb +5 -0
- data/spec/helpers/class_methods_spec_helpers.rb +5 -0
- data/spec/helpers/migration_spec_helpers.rb +42 -0
- data/spec/migration_spec.rb +74 -0
- data/spec/spec_helper.rb +24 -0
- metadata +220 -0
@@ -0,0 +1,12 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key is used for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
|
6
|
+
# Make sure the secret is at least 30 characters and all random,
|
7
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
8
|
+
# You can use `rake secret` to generate a secure secret key.
|
9
|
+
|
10
|
+
# Make sure your secret_key_base is kept private
|
11
|
+
# if you're sharing your code publicly.
|
12
|
+
Dummy::Application.config.secret_key_base = 'faafc422bc7236ba580b411040fef0940a0489b964df998a38f1bc1d7ab91b23cebbd1e3d301a85e460dc0ab2b173ae7011ffca1e7b28add7ac463e1cd5c6cc3'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
+
# is enabled by default.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
8
|
+
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
9
|
+
end
|
10
|
+
|
11
|
+
# To enable root element in JSON for ActiveRecord objects.
|
12
|
+
# ActiveSupport.on_load(:active_record) do
|
13
|
+
# self.include_root_in_json = true
|
14
|
+
# end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Files in the config/locales directory are used for internationalization
|
2
|
+
# and are automatically loaded by Rails. If you want to use locales other
|
3
|
+
# than English, add the necessary files in this directory.
|
4
|
+
#
|
5
|
+
# To use the locales, use `I18n.t`:
|
6
|
+
#
|
7
|
+
# I18n.t 'hello'
|
8
|
+
#
|
9
|
+
# In views, this is aliased to just `t`:
|
10
|
+
#
|
11
|
+
# <%= t('hello') %>
|
12
|
+
#
|
13
|
+
# To use a different locale, set it with `I18n.locale`:
|
14
|
+
#
|
15
|
+
# I18n.locale = :es
|
16
|
+
#
|
17
|
+
# This would use the information in config/locales/es.yml.
|
18
|
+
#
|
19
|
+
# To learn more, please read the Rails Internationalization guide
|
20
|
+
# available at http://guides.rubyonrails.org/i18n.html.
|
21
|
+
|
22
|
+
en:
|
23
|
+
hello: "Hello world"
|
@@ -0,0 +1,56 @@
|
|
1
|
+
Dummy::Application.routes.draw do
|
2
|
+
# The priority is based upon order of creation: first created -> highest priority.
|
3
|
+
# See how all your routes lay out with "rake routes".
|
4
|
+
|
5
|
+
# You can have the root of your site routed with "root"
|
6
|
+
# root 'welcome#index'
|
7
|
+
|
8
|
+
# Example of regular route:
|
9
|
+
# get 'products/:id' => 'catalog#view'
|
10
|
+
|
11
|
+
# Example of named route that can be invoked with purchase_url(id: product.id)
|
12
|
+
# get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
|
13
|
+
|
14
|
+
# Example resource route (maps HTTP verbs to controller actions automatically):
|
15
|
+
# resources :products
|
16
|
+
|
17
|
+
# Example resource route with options:
|
18
|
+
# resources :products do
|
19
|
+
# member do
|
20
|
+
# get 'short'
|
21
|
+
# post 'toggle'
|
22
|
+
# end
|
23
|
+
#
|
24
|
+
# collection do
|
25
|
+
# get 'sold'
|
26
|
+
# end
|
27
|
+
# end
|
28
|
+
|
29
|
+
# Example resource route with sub-resources:
|
30
|
+
# resources :products do
|
31
|
+
# resources :comments, :sales
|
32
|
+
# resource :seller
|
33
|
+
# end
|
34
|
+
|
35
|
+
# Example resource route with more complex sub-resources:
|
36
|
+
# resources :products do
|
37
|
+
# resources :comments
|
38
|
+
# resources :sales do
|
39
|
+
# get 'recent', on: :collection
|
40
|
+
# end
|
41
|
+
# end
|
42
|
+
|
43
|
+
# Example resource route with concerns:
|
44
|
+
# concern :toggleable do
|
45
|
+
# post 'toggle'
|
46
|
+
# end
|
47
|
+
# resources :posts, concerns: :toggleable
|
48
|
+
# resources :photos, concerns: :toggleable
|
49
|
+
|
50
|
+
# Example resource route within a namespace:
|
51
|
+
# namespace :admin do
|
52
|
+
# # Directs /admin/products/* to Admin::ProductsController
|
53
|
+
# # (app/controllers/admin/products_controller.rb)
|
54
|
+
# resources :products
|
55
|
+
# end
|
56
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
class StartEnterpriseMti < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
enterprise_mti_up superclass_table: 'superthings', subclass_tables: ['subthing_ones', 'subthing_twos']
|
4
|
+
end
|
5
|
+
|
6
|
+
def down
|
7
|
+
enterprise_mti_down superclass_table: 'superthings', subclass_tables: ['subthing_ones', 'subthing_twos']
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,42 @@
|
|
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: 0) do
|
15
|
+
|
16
|
+
# These are extensions that must be enabled in order to support this database
|
17
|
+
enable_extension "plpgsql"
|
18
|
+
|
19
|
+
create_table "subthing_ones", force: true do |t|
|
20
|
+
t.text "content"
|
21
|
+
t.datetime "created_at"
|
22
|
+
t.datetime "updated_at"
|
23
|
+
end
|
24
|
+
|
25
|
+
create_table "subthing_twos", force: true do |t|
|
26
|
+
t.text "content"
|
27
|
+
t.datetime "created_at"
|
28
|
+
t.datetime "updated_at"
|
29
|
+
end
|
30
|
+
|
31
|
+
create_table "superthings", force: true do |t|
|
32
|
+
t.text "content"
|
33
|
+
t.datetime "created_at"
|
34
|
+
t.datetime "updated_at"
|
35
|
+
t.integer "subthing_ones_id", limit: 8, null: false
|
36
|
+
t.integer "subthing_twos_id", limit: 8, null: false
|
37
|
+
end
|
38
|
+
|
39
|
+
add_index "superthings", ["subthing_ones_id"], name: "superthings_subthing_ones_id_key", unique: true, using: :btree
|
40
|
+
add_index "superthings", ["subthing_twos_id"], name: "superthings_subthing_twos_id_key", unique: true, using: :btree
|
41
|
+
|
42
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
2
|
+
[1m[35m (2163.5ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
3
|
+
[1m[36m (60.6ms)[0m [1mDROP TABLE "superthings"[0m
|
4
|
+
[1m[35m (2.2ms)[0m ROLLBACK
|
5
|
+
[1m[36m (47.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) [0m
|
6
|
+
[1m[35m (3.1ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
7
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.9ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
8
|
+
[1m[35mActiveRecord::SchemaMigration Load (9.4ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
9
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
10
|
+
PG::UndefinedTable: ERROR: relation "superthings" does not exist
|
11
|
+
LINE 5: WHERE a.attrelid = '"superthings"'::regclass
|
12
|
+
^
|
13
|
+
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
|
14
|
+
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
|
15
|
+
FROM pg_attribute a LEFT JOIN pg_attrdef d
|
16
|
+
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
|
17
|
+
WHERE a.attrelid = '"superthings"'::regclass
|
18
|
+
AND a.attnum > 0 AND NOT a.attisdropped
|
19
|
+
ORDER BY a.attnum
|
20
|
+
|
21
|
+
[1m[35m (0.4ms)[0m ROLLBACK
|
22
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
23
|
+
[1m[35m (0.4ms)[0m ROLLBACK
|
24
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
25
|
+
[1m[35m (0.4ms)[0m ROLLBACK
|
26
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
27
|
+
[1m[35m (0.4ms)[0m ROLLBACK
|
28
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
29
|
+
[1m[35m (0.4ms)[0m ROLLBACK
|
30
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
31
|
+
[1m[35m (0.4ms)[0m ROLLBACK
|
32
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
33
|
+
[1m[35m (0.4ms)[0m ROLLBACK
|
34
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
35
|
+
[1m[35m (0.4ms)[0m ROLLBACK
|
@@ -0,0 +1,1683 @@
|
|
1
|
+
[1m[36m (510.3ms)[0m [1mselect * from information_schema.columns where table_name='superclass_migration'[0m
|
2
|
+
[1m[36m (25.4ms)[0m [1mselect * from information_schema.columns where table_name='superclass_migration'[0m
|
3
|
+
[1m[36m (26.1ms)[0m [1mselect * from information_schema.columns where table_name='superclass_migration'[0m
|
4
|
+
[1m[36m (24.6ms)[0m [1mselect * from information_schema.columns where table_name='superclass_migration'[0m
|
5
|
+
[1m[36m (0.5ms)[0m [1mselect * from information_schema.columns where table='superclass_migration'[0m
|
6
|
+
PG::SyntaxError: ERROR: syntax error at or near "table"
|
7
|
+
LINE 1: select * from information_schema.columns where table='superc...
|
8
|
+
^
|
9
|
+
: select * from information_schema.columns where table='superclass_migration'
|
10
|
+
[1m[36m (31.4ms)[0m [1mselect * from information_schema.columns where table_name='superthings'[0m
|
11
|
+
[1m[36m (35.9ms)[0m [1mselect * from information_schema.columns where table_name='superthings'[0m
|
12
|
+
[1m[36m (28.6ms)[0m [1mselect * from information_schema.columns where table_name='superthings'[0m
|
13
|
+
[1m[36m (23.8ms)[0m [1mselect * from information_schema.columns where table_name='superthings'[0m
|
14
|
+
[1m[36m (215.3ms)[0m [1mCREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
15
|
+
[1m[35m (89.5ms)[0m select * from information_schema.columns where table_name='superthings'
|
16
|
+
[1m[36m (7.3ms)[0m [1mDROP TABLE "superthings"[0m
|
17
|
+
[1m[36m (26.1ms)[0m [1mCREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
18
|
+
[1m[35m (41.2ms)[0m select * from information_schema.columns where table_name='superthings'
|
19
|
+
[1m[36m (10.7ms)[0m [1mDROP TABLE "superthings"[0m
|
20
|
+
[1m[36m (21.1ms)[0m [1mCREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
21
|
+
[1m[35m (32.9ms)[0m select * from information_schema.columns where table_name='superthings'
|
22
|
+
[1m[36m (4.9ms)[0m [1mDROP TABLE "superthings"[0m
|
23
|
+
[1m[36m (30.0ms)[0m [1mselect * from information_schema.columns where table_name='superthings'[0m
|
24
|
+
[1m[36m (25.4ms)[0m [1mselect * from information_schema.columns where table_name='superthings'[0m
|
25
|
+
[1m[36m (34.5ms)[0m [1mselect column_name from information_schema.columns where table_name='superthings'[0m
|
26
|
+
[1m[36m (28.4ms)[0m [1mCREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
27
|
+
[1m[35m (10.9ms)[0m CREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
28
|
+
[1m[36m (8.6ms)[0m [1mCREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
29
|
+
[1m[35m (55.8ms)[0m select column_name from information_schema.columns where table_name='superthings'
|
30
|
+
[1m[36m (5.6ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
31
|
+
[1m[35m (10.9ms)[0m DROP TABLE "subthing_ones"
|
32
|
+
[1m[36m (11.8ms)[0m [1mDROP TABLE "superthings"[0m
|
33
|
+
[1m[36m (24.8ms)[0m [1mCREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
34
|
+
[1m[35m (9.2ms)[0m CREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
35
|
+
[1m[36m (15.6ms)[0m [1mCREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
36
|
+
[1m[35m (28.3ms)[0m select column_name from information_schema.columns where table_name='superthings'
|
37
|
+
|
38
|
+
[1m[36m (5.5ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
39
|
+
[1m[35m (4.0ms)[0m DROP TABLE "subthing_ones"
|
40
|
+
[1m[36m (6.6ms)[0m [1mDROP TABLE "superthings"[0m
|
41
|
+
[1m[36m (19.0ms)[0m [1mCREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
42
|
+
[1m[35m (10.3ms)[0m CREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
43
|
+
[1m[36m (22.6ms)[0m [1mCREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
44
|
+
[1m[35m (24.9ms)[0m select column_name from information_schema.columns where table_name='superthings'
|
45
|
+
|
46
|
+
[1m[36m (4.9ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
47
|
+
[1m[35m (5.1ms)[0m DROP TABLE "subthing_ones"
|
48
|
+
[1m[36m (4.4ms)[0m [1mDROP TABLE "superthings"[0m
|
49
|
+
[1m[36m (68.7ms)[0m [1mCREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
50
|
+
[1m[35m (9.3ms)[0m CREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
51
|
+
[1m[36m (11.0ms)[0m [1mCREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
52
|
+
[1m[35m (35.8ms)[0m select column_name from information_schema.columns where table_name='superthings'
|
53
|
+
|
54
|
+
[1m[36m (5.0ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
55
|
+
[1m[35m (4.0ms)[0m DROP TABLE "subthing_ones"
|
56
|
+
[1m[36m (4.9ms)[0m [1mDROP TABLE "superthings"[0m
|
57
|
+
[1m[36m (19.9ms)[0m [1mCREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
58
|
+
[1m[35m (8.5ms)[0m CREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
59
|
+
[1m[36m (19.2ms)[0m [1mCREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
60
|
+
[1m[35m (24.2ms)[0m select column_name from information_schema.columns where table_name='superthings'
|
61
|
+
|
62
|
+
[1m[36m (5.8ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
63
|
+
[1m[35m (8.0ms)[0m DROP TABLE "subthing_ones"
|
64
|
+
[1m[36m (7.9ms)[0m [1mDROP TABLE "superthings"[0m
|
65
|
+
[1m[36m (0.9ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
66
|
+
PG::UndefinedTable: ERROR: table "subthing_twos" does not exist
|
67
|
+
: DROP TABLE "subthing_twos"
|
68
|
+
[1m[36m (32.0ms)[0m [1mCREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
69
|
+
[1m[35m (10.4ms)[0m CREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
70
|
+
[1m[36m (9.5ms)[0m [1mCREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
71
|
+
[1m[35m (85.6ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
72
|
+
[1m[36m (44.3ms)[0m [1m select * from information_schema.columns where table_name='superthings'
|
73
|
+
[0m
|
74
|
+
[1m[35m (1.9ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
75
|
+
PG::DuplicateColumn: ERROR: column "subthing_ones_id" of relation "superthings" already exists
|
76
|
+
: ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
77
|
+
[1m[36m (8.3ms)[0m [1mCREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
78
|
+
PG::DuplicateTable: ERROR: relation "superthings" already exists
|
79
|
+
: CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
80
|
+
[1m[35m (3.3ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
81
|
+
PG::DuplicateColumn: ERROR: column "subthing_ones_id" of relation "superthings" already exists
|
82
|
+
: ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
83
|
+
[1m[36m (19.3ms)[0m [1mCREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
84
|
+
PG::DuplicateTable: ERROR: relation "superthings" already exists
|
85
|
+
: CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
86
|
+
[1m[35m (1.6ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
87
|
+
PG::DuplicateColumn: ERROR: column "subthing_ones_id" of relation "superthings" already exists
|
88
|
+
: ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
89
|
+
[1m[36m (16.2ms)[0m [1mCREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
90
|
+
PG::DuplicateTable: ERROR: relation "superthings" already exists
|
91
|
+
: CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
92
|
+
[1m[35m (3.4ms)[0m DROP TABLE "subthing_twos"
|
93
|
+
PG::DependentObjectsStillExist: ERROR: cannot drop table subthing_twos because other objects depend on it
|
94
|
+
DETAIL: constraint superthings_subthing_twos_id_fkey on table superthings depends on table subthing_twos
|
95
|
+
HINT: Use DROP ... CASCADE to drop the dependent objects too.
|
96
|
+
: DROP TABLE "subthing_twos"
|
97
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
98
|
+
[1m[35m (8.2ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
99
|
+
PG::DuplicateTable: ERROR: relation "superthings" already exists
|
100
|
+
: CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
101
|
+
[1m[36m (0.2ms)[0m [1mROLLBACK[0m
|
102
|
+
[1m[35m (0.4ms)[0m BEGIN
|
103
|
+
[1m[36m (5.2ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
104
|
+
PG::DependentObjectsStillExist: ERROR: cannot drop table subthing_twos because other objects depend on it
|
105
|
+
DETAIL: constraint superthings_subthing_twos_id_fkey on table superthings depends on table subthing_twos
|
106
|
+
HINT: Use DROP ... CASCADE to drop the dependent objects too.
|
107
|
+
: DROP TABLE "subthing_twos"
|
108
|
+
[1m[35m (0.5ms)[0m ROLLBACK
|
109
|
+
[1m[36m (3.2ms)[0m [1mBEGIN[0m
|
110
|
+
[1m[35m (18.0ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
111
|
+
[1m[36m (10.2ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
112
|
+
[1m[35m (19.6ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
113
|
+
[1m[36m (8.0ms)[0m [1mCOMMIT[0m
|
114
|
+
[1m[35m (36.1ms)[0m select * from information_schema.columns where table_name='superthings'
|
115
|
+
|
116
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
117
|
+
[1m[35m (7.3ms)[0m DROP TABLE "subthing_twos"
|
118
|
+
[1m[36m (3.3ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
119
|
+
[1m[35m (2.6ms)[0m DROP TABLE "superthings"
|
120
|
+
[1m[36m (8.0ms)[0m [1mCOMMIT[0m
|
121
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
122
|
+
[1m[35m (15.5ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
123
|
+
[1m[36m (7.9ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
124
|
+
[1m[35m (14.3ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
125
|
+
[1m[36m (25.9ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
126
|
+
[1m[35m (3.3ms)[0m COMMIT
|
127
|
+
[1m[36m (47.3ms)[0m [1m select * from information_schema.columns where table_name='superthings'
|
128
|
+
[0m
|
129
|
+
[1m[35m (0.4ms)[0m BEGIN
|
130
|
+
[1m[36m (1.8ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
131
|
+
PG::DuplicateColumn: ERROR: column "subthing_ones_id" of relation "superthings" already exists
|
132
|
+
: ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
133
|
+
[1m[35m (0.4ms)[0m ROLLBACK
|
134
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
135
|
+
[1m[35m (14.9ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
136
|
+
[1m[36m (8.8ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
137
|
+
[1m[35m (7.7ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
138
|
+
[1m[36m (34.1ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
139
|
+
[1m[35m (5.5ms)[0m COMMIT
|
140
|
+
[1m[36m (32.8ms)[0m [1m select * from information_schema.columns where table_name='superthings'
|
141
|
+
[0m
|
142
|
+
[1m[35m (0.2ms)[0m BEGIN
|
143
|
+
[1m[36m (1.6ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
144
|
+
PG::DuplicateColumn: ERROR: column "subthing_ones_id" of relation "superthings" already exists
|
145
|
+
: ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
146
|
+
[1m[35m (0.2ms)[0m ROLLBACK
|
147
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
148
|
+
[1m[35m (20.3ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
149
|
+
[1m[36m (8.1ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
150
|
+
[1m[35m (9.2ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
151
|
+
[1m[36m (26.1ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
152
|
+
[1m[35m (5.7ms)[0m COMMIT
|
153
|
+
[1m[36m (49.1ms)[0m [1m select * from information_schema.columns where table_name='superthings'
|
154
|
+
[0m
|
155
|
+
[1m[35m (0.5ms)[0m BEGIN
|
156
|
+
[1m[36m (6.6ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
157
|
+
[1m[35m (2.7ms)[0m DROP TABLE "subthing_twos"
|
158
|
+
[1m[36m (3.1ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
159
|
+
[1m[35m (3.1ms)[0m DROP TABLE "superthings"
|
160
|
+
[1m[36m (9.5ms)[0m [1mCOMMIT[0m
|
161
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
162
|
+
[1m[35m (24.2ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
163
|
+
[1m[36m (8.2ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
164
|
+
[1m[35m (9.7ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
165
|
+
[1m[36m (22.9ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
166
|
+
[1m[35m (4.8ms)[0m COMMIT
|
167
|
+
[1m[36m (11.0ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
168
|
+
[1m[35m (26.4ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
169
|
+
[1m[36m (0.9ms)[0m [1mBEGIN[0m
|
170
|
+
[1m[35m (6.8ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
171
|
+
[1m[36m (2.8ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
172
|
+
[1m[35m (2.7ms)[0m DROP TABLE "subthing_ones"
|
173
|
+
[1m[36m (2.6ms)[0m [1mDROP TABLE "superthings"[0m
|
174
|
+
[1m[35m (4.3ms)[0m COMMIT
|
175
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
176
|
+
[1m[35m (17.4ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
177
|
+
[1m[36m (14.6ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
178
|
+
[1m[35m (10.0ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
179
|
+
[1m[36m (25.0ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
180
|
+
[1m[35m (13.1ms)[0m COMMIT
|
181
|
+
[1m[36m (9.1ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
182
|
+
[1m[35m (15.2ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
183
|
+
[1m[36m (0.5ms)[0m [1mBEGIN[0m
|
184
|
+
[1m[35m (8.2ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
185
|
+
[1m[36m (3.0ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
186
|
+
[1m[35m (2.7ms)[0m DROP TABLE "subthing_ones"
|
187
|
+
[1m[36m (2.6ms)[0m [1mDROP TABLE "superthings"[0m
|
188
|
+
[1m[35m (4.3ms)[0m COMMIT
|
189
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
190
|
+
[1m[35m (22.6ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
191
|
+
[1m[36m (16.1ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
192
|
+
[1m[35m (7.7ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
193
|
+
[1m[36m (38.4ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
194
|
+
[1m[35m (13.5ms)[0m COMMIT
|
195
|
+
[1m[36m (8.8ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
196
|
+
[1m[35m (21.3ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
197
|
+
[1m[36m (0.5ms)[0m [1mBEGIN[0m
|
198
|
+
[1m[35m (5.1ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
199
|
+
[1m[36m (3.1ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
200
|
+
[1m[35m (2.2ms)[0m DROP TABLE "subthing_ones"
|
201
|
+
[1m[36m (2.2ms)[0m [1mDROP TABLE "superthings"[0m
|
202
|
+
[1m[35m (14.4ms)[0m COMMIT
|
203
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
204
|
+
[1m[35m (11.9ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
205
|
+
[1m[36m (7.3ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
206
|
+
[1m[35m (8.6ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
207
|
+
[1m[36m (26.5ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
208
|
+
[1m[35m (5.1ms)[0m COMMIT
|
209
|
+
[1m[36m (9.9ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
210
|
+
[1m[35m (21.9ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
211
|
+
[1m[36m (1.4ms)[0m [1mBEGIN[0m
|
212
|
+
[1m[35m (14.0ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
213
|
+
[1m[36m (2.6ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
214
|
+
[1m[35m (2.7ms)[0m DROP TABLE "subthing_ones"
|
215
|
+
[1m[36m (4.7ms)[0m [1mDROP TABLE "superthings"[0m
|
216
|
+
[1m[35m (6.3ms)[0m COMMIT
|
217
|
+
[1m[36m (0.7ms)[0m [1mBEGIN[0m
|
218
|
+
[1m[35m (11.1ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
219
|
+
[1m[36m (9.9ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
220
|
+
[1m[35m (9.7ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
221
|
+
[1m[36m (15.7ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
222
|
+
[1m[35m (3.9ms)[0m COMMIT
|
223
|
+
[1m[36m (6.3ms)[0m [1m select * from information_schema.columns where table_name=superthings
|
224
|
+
[0m
|
225
|
+
PG::UndefinedColumn: ERROR: column "superthings" does not exist
|
226
|
+
LINE 1: ... from information_schema.columns where table_name=superthing...
|
227
|
+
^
|
228
|
+
: select * from information_schema.columns where table_name=superthings
|
229
|
+
|
230
|
+
[1m[35m (0.8ms)[0m select * from information_schema.columns where table_name=superthings
|
231
|
+
|
232
|
+
PG::UndefinedColumn: ERROR: column "superthings" does not exist
|
233
|
+
LINE 1: ... from information_schema.columns where table_name=superthing...
|
234
|
+
^
|
235
|
+
: select * from information_schema.columns where table_name=superthings
|
236
|
+
|
237
|
+
[1m[36m (20.5ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
238
|
+
[1m[35m (18.6ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
239
|
+
[1m[36m (1.0ms)[0m [1mBEGIN[0m
|
240
|
+
[1m[35m (5.7ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
241
|
+
[1m[36m (4.2ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
242
|
+
[1m[35m (4.9ms)[0m DROP TABLE "subthing_ones"
|
243
|
+
[1m[36m (10.0ms)[0m [1mDROP TABLE "superthings"[0m
|
244
|
+
[1m[35m (5.4ms)[0m COMMIT
|
245
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
246
|
+
[1m[35m (17.1ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
247
|
+
[1m[36m (7.9ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
248
|
+
[1m[35m (7.7ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
249
|
+
[1m[36m (24.5ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
250
|
+
[1m[35m (6.9ms)[0m COMMIT
|
251
|
+
[1m[36m (18.1ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
252
|
+
[1m[35m (13.0ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
253
|
+
[1m[36m (5.9ms)[0m [1m select * from information_schema.columns where table_name="superthings"
|
254
|
+
[0m
|
255
|
+
PG::UndefinedColumn: ERROR: column "superthings" does not exist
|
256
|
+
LINE 1: ... from information_schema.columns where table_name="superthin...
|
257
|
+
^
|
258
|
+
: select * from information_schema.columns where table_name="superthings"
|
259
|
+
|
260
|
+
[1m[35m (0.6ms)[0m select * from information_schema.columns where table_name="superthings"
|
261
|
+
|
262
|
+
PG::UndefinedColumn: ERROR: column "superthings" does not exist
|
263
|
+
LINE 1: ... from information_schema.columns where table_name="superthin...
|
264
|
+
^
|
265
|
+
: select * from information_schema.columns where table_name="superthings"
|
266
|
+
|
267
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
268
|
+
[1m[35m (5.8ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
269
|
+
[1m[36m (2.7ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
270
|
+
[1m[35m (2.8ms)[0m DROP TABLE "subthing_ones"
|
271
|
+
[1m[36m (2.7ms)[0m [1mDROP TABLE "superthings"[0m
|
272
|
+
[1m[35m (18.3ms)[0m COMMIT
|
273
|
+
[1m[36m (0.9ms)[0m [1mBEGIN[0m
|
274
|
+
[1m[35m (16.7ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
275
|
+
[1m[36m (8.9ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
276
|
+
[1m[35m (7.3ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
277
|
+
[1m[36m (17.5ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
278
|
+
[1m[35m (2.9ms)[0m COMMIT
|
279
|
+
[1m[36m (10.2ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
280
|
+
[1m[35m (28.0ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
281
|
+
[1m[36m (4.6ms)[0m [1m select * from information_schema.columns where table_name="superthings";
|
282
|
+
[0m
|
283
|
+
PG::UndefinedColumn: ERROR: column "superthings" does not exist
|
284
|
+
LINE 1: ... from information_schema.columns where table_name="superthin...
|
285
|
+
^
|
286
|
+
: select * from information_schema.columns where table_name="superthings";
|
287
|
+
|
288
|
+
[1m[35m (0.9ms)[0m select * from information_schema.columns where table_name="superthings";
|
289
|
+
|
290
|
+
PG::UndefinedColumn: ERROR: column "superthings" does not exist
|
291
|
+
LINE 1: ... from information_schema.columns where table_name="superthin...
|
292
|
+
^
|
293
|
+
: select * from information_schema.columns where table_name="superthings";
|
294
|
+
|
295
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
296
|
+
[1m[35m (5.4ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
297
|
+
[1m[36m (2.7ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
298
|
+
[1m[35m (2.7ms)[0m DROP TABLE "subthing_ones"
|
299
|
+
[1m[36m (3.1ms)[0m [1mDROP TABLE "superthings"[0m
|
300
|
+
[1m[35m (6.0ms)[0m COMMIT
|
301
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
302
|
+
[1m[35m (18.2ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
303
|
+
[1m[36m (9.1ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
304
|
+
[1m[35m (9.3ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
305
|
+
[1m[36m (24.7ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
306
|
+
[1m[35m (3.5ms)[0m COMMIT
|
307
|
+
[1m[36m (6.0ms)[0m [1m select * from information_schema.columns where table_name="superthings";
|
308
|
+
[0m
|
309
|
+
PG::UndefinedColumn: ERROR: column "superthings" does not exist
|
310
|
+
LINE 1: ... from information_schema.columns where table_name="superthin...
|
311
|
+
^
|
312
|
+
: select * from information_schema.columns where table_name="superthings";
|
313
|
+
|
314
|
+
[1m[35m (1.3ms)[0m select * from information_schema.columns where table_name="superthings";
|
315
|
+
|
316
|
+
PG::UndefinedColumn: ERROR: column "superthings" does not exist
|
317
|
+
LINE 1: ... from information_schema.columns where table_name="superthin...
|
318
|
+
^
|
319
|
+
: select * from information_schema.columns where table_name="superthings";
|
320
|
+
|
321
|
+
[1m[36m (14.3ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
322
|
+
[1m[35m (1.2ms)[0m select * from information_schema.columns where table_name="superthings";
|
323
|
+
|
324
|
+
PG::UndefinedColumn: ERROR: column "superthings" does not exist
|
325
|
+
LINE 1: ... from information_schema.columns where table_name="superthin...
|
326
|
+
^
|
327
|
+
: select * from information_schema.columns where table_name="superthings";
|
328
|
+
|
329
|
+
[1m[36m (0.7ms)[0m [1m select * from information_schema.columns where table_name="superthings";
|
330
|
+
[0m
|
331
|
+
PG::UndefinedColumn: ERROR: column "superthings" does not exist
|
332
|
+
LINE 1: ... from information_schema.columns where table_name="superthin...
|
333
|
+
^
|
334
|
+
: select * from information_schema.columns where table_name="superthings";
|
335
|
+
|
336
|
+
[1m[35m (25.6ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
337
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
338
|
+
[1m[35m (5.7ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
339
|
+
[1m[36m (2.9ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
340
|
+
[1m[35m (2.8ms)[0m DROP TABLE "subthing_ones"
|
341
|
+
[1m[36m (3.0ms)[0m [1mDROP TABLE "superthings"[0m
|
342
|
+
[1m[35m (10.9ms)[0m COMMIT
|
343
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
344
|
+
[1m[35m (20.7ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
345
|
+
[1m[36m (7.8ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
346
|
+
[1m[35m (12.4ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
347
|
+
[1m[36m (15.5ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
348
|
+
[1m[35m (9.9ms)[0m COMMIT
|
349
|
+
[1m[36m (15.5ms)[0m [1m select * from information_schema.columns where table_name="superthings";
|
350
|
+
[0m
|
351
|
+
PG::UndefinedColumn: ERROR: column "superthings" does not exist
|
352
|
+
LINE 1: ... from information_schema.columns where table_name="superthin...
|
353
|
+
^
|
354
|
+
: select * from information_schema.columns where table_name="superthings";
|
355
|
+
|
356
|
+
[1m[35m (1.1ms)[0m select * from information_schema.columns where table_name="superthings";
|
357
|
+
|
358
|
+
PG::UndefinedColumn: ERROR: column "superthings" does not exist
|
359
|
+
LINE 1: ... from information_schema.columns where table_name="superthin...
|
360
|
+
^
|
361
|
+
: select * from information_schema.columns where table_name="superthings";
|
362
|
+
|
363
|
+
[1m[36m (0.7ms)[0m [1mBEGIN[0m
|
364
|
+
[1m[35m (6.4ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
365
|
+
[1m[36m (2.4ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
366
|
+
[1m[35m (3.8ms)[0m DROP TABLE "subthing_ones"
|
367
|
+
[1m[36m (4.2ms)[0m [1mDROP TABLE "superthings"[0m
|
368
|
+
[1m[35m (12.4ms)[0m COMMIT
|
369
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
370
|
+
[1m[35m (30.8ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
371
|
+
[1m[36m (8.9ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
372
|
+
[1m[35m (8.5ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
373
|
+
[1m[36m (17.8ms)[0m [1mCOMMIT[0m
|
374
|
+
[1m[35m (2.1ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
375
|
+
PG::UndefinedObject: ERROR: constraint "id_fkey" of relation "subthing_ones" does not exist
|
376
|
+
: ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
377
|
+
[1m[36m (29.7ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
378
|
+
[1m[35m (11.3ms)[0m select * from information_schema.columns where table_name="superthings";
|
379
|
+
|
380
|
+
PG::UndefinedColumn: ERROR: column "superthings" does not exist
|
381
|
+
LINE 1: ... from information_schema.columns where table_name="superthin...
|
382
|
+
^
|
383
|
+
: select * from information_schema.columns where table_name="superthings";
|
384
|
+
|
385
|
+
[1m[36m (0.5ms)[0m [1m select * from information_schema.columns where table_name="superthings";
|
386
|
+
[0m
|
387
|
+
PG::UndefinedColumn: ERROR: column "superthings" does not exist
|
388
|
+
LINE 1: ... from information_schema.columns where table_name="superthin...
|
389
|
+
^
|
390
|
+
: select * from information_schema.columns where table_name="superthings";
|
391
|
+
|
392
|
+
[1m[35m (0.3ms)[0m BEGIN
|
393
|
+
[1m[36m (1.7ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
394
|
+
PG::DependentObjectsStillExist: ERROR: cannot drop table subthing_twos because other objects depend on it
|
395
|
+
DETAIL: constraint superthings_subthing_twos_id_fkey on table superthings depends on table subthing_twos
|
396
|
+
HINT: Use DROP ... CASCADE to drop the dependent objects too.
|
397
|
+
: DROP TABLE "subthing_twos"
|
398
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
399
|
+
[1m[36m (6.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) [0m
|
400
|
+
[1m[35m (3.2ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
401
|
+
[1m[36mActiveRecord::SchemaMigration Load (1.7ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
402
|
+
Migrating to CreateSuperthings (20131029213145)
|
403
|
+
[1m[35m (0.5ms)[0m BEGIN
|
404
|
+
[1m[36m (4.3ms)[0m [1mCREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
405
|
+
PG::DuplicateTable: ERROR: relation "superthings" already exists
|
406
|
+
: CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
407
|
+
[1m[35m (0.3ms)[0m ROLLBACK
|
408
|
+
[1m[36mActiveRecord::SchemaMigration Load (1.0ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
409
|
+
Migrating to CreateSuperthings (20131029213145)
|
410
|
+
[1m[35m (0.3ms)[0m BEGIN
|
411
|
+
[1m[36m (28.9ms)[0m [1mCREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
412
|
+
PG::DuplicateTable: ERROR: relation "superthings" already exists
|
413
|
+
: CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
414
|
+
[1m[35m (0.2ms)[0m ROLLBACK
|
415
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
416
|
+
[1m[35m (28.0ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
417
|
+
PG::DuplicateTable: ERROR: relation "superthings" already exists
|
418
|
+
: CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
419
|
+
[1m[36m (3.5ms)[0m [1mROLLBACK[0m
|
420
|
+
[1m[35m (0.3ms)[0m BEGIN
|
421
|
+
[1m[36m (3.2ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
422
|
+
PG::DependentObjectsStillExist: ERROR: cannot drop table subthing_twos because other objects depend on it
|
423
|
+
DETAIL: constraint superthings_subthing_twos_id_fkey on table superthings depends on table subthing_twos
|
424
|
+
HINT: Use DROP ... CASCADE to drop the dependent objects too.
|
425
|
+
: DROP TABLE "subthing_twos"
|
426
|
+
[1m[35m (0.2ms)[0m ROLLBACK
|
427
|
+
[1m[36mActiveRecord::SchemaMigration Load (1.0ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
428
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.7ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
429
|
+
[1m[36m (9.6ms)[0m [1mBEGIN[0m
|
430
|
+
[1m[35m (14.3ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
431
|
+
[1m[36m (8.1ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
432
|
+
[1m[35m (16.5ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
433
|
+
[1m[36m (4.8ms)[0m [1mCOMMIT[0m
|
434
|
+
[1m[35m (41.1ms)[0m select * from information_schema.columns where table_name='superthings';
|
435
|
+
|
436
|
+
[1m[36m (13.4ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
437
|
+
[0m
|
438
|
+
[1m[35m (1.0ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
439
|
+
PG::UndefinedObject: ERROR: constraint "id_fkey" of relation "subthing_ones" does not exist
|
440
|
+
: ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
441
|
+
[1m[36m (15.8ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
442
|
+
[1m[35m (0.3ms)[0m BEGIN
|
443
|
+
[1m[36m (9.7ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
444
|
+
PG::DependentObjectsStillExist: ERROR: cannot drop table subthing_twos because other objects depend on it
|
445
|
+
DETAIL: constraint superthings_subthing_twos_id_fkey on table superthings depends on table subthing_twos
|
446
|
+
HINT: Use DROP ... CASCADE to drop the dependent objects too.
|
447
|
+
: DROP TABLE "subthing_twos"
|
448
|
+
[1m[35m (0.4ms)[0m ROLLBACK
|
449
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
450
|
+
[1m[35m (17.0ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
451
|
+
[1m[36m (8.3ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
452
|
+
[1m[35m (10.5ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
453
|
+
[1m[36m (21.7ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
454
|
+
[1m[35m (6.1ms)[0m COMMIT
|
455
|
+
[1m[36m (39.3ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
456
|
+
[0m
|
457
|
+
[1m[35m (15.9ms)[0m select * from information_schema.columns where table_name='superthings';
|
458
|
+
|
459
|
+
[1m[36m (7.9ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
460
|
+
[1m[35m (27.5ms)[0m select * from information_schema.columns where table_name='superthings';
|
461
|
+
|
462
|
+
[1m[36m (17.4ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
463
|
+
[0m
|
464
|
+
[1m[35m (22.1ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
465
|
+
[1m[36m (0.4ms)[0m [1mBEGIN[0m
|
466
|
+
[1m[35m (5.5ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
467
|
+
[1m[36m (11.3ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
468
|
+
[1m[35m (2.4ms)[0m DROP TABLE "subthing_ones"
|
469
|
+
[1m[36m (3.0ms)[0m [1mDROP TABLE "superthings"[0m
|
470
|
+
[1m[35m (4.2ms)[0m COMMIT
|
471
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
472
|
+
[1m[35m (11.8ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
473
|
+
[1m[36m (17.0ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
474
|
+
[1m[35m (12.5ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
475
|
+
[1m[36m (16.4ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
476
|
+
[1m[35m (2.8ms)[0m COMMIT
|
477
|
+
[1m[36m (9.6ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
478
|
+
[1m[35m (43.0ms)[0m select * from information_schema.columns where table_name='superthings';
|
479
|
+
|
480
|
+
[1m[36m (16.7ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
481
|
+
[0m
|
482
|
+
[1m[35m (30.9ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
483
|
+
[1m[36m (15.6ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
484
|
+
[0m
|
485
|
+
[1m[35m (16.8ms)[0m select * from information_schema.columns where table_name='superthings';
|
486
|
+
|
487
|
+
[1m[36m (2.0ms)[0m [1mBEGIN[0m
|
488
|
+
[1m[35m (5.6ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
489
|
+
[1m[36m (2.7ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
490
|
+
[1m[35m (5.8ms)[0m DROP TABLE "subthing_ones"
|
491
|
+
[1m[36m (3.5ms)[0m [1mDROP TABLE "superthings"[0m
|
492
|
+
[1m[35m (0.8ms)[0m ROLLBACK
|
493
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
494
|
+
[1m[35m (5.0ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
495
|
+
PG::DuplicateTable: ERROR: relation "superthings" already exists
|
496
|
+
: CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
497
|
+
[1m[36m (1.0ms)[0m [1mROLLBACK[0m
|
498
|
+
[1m[35m (0.3ms)[0m BEGIN
|
499
|
+
[1m[36m (7.3ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
500
|
+
[1m[35m (2.8ms)[0m DROP TABLE "subthing_twos"
|
501
|
+
[1m[36m (2.5ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
502
|
+
[1m[35m (2.4ms)[0m DROP TABLE "superthings"
|
503
|
+
[1m[36m (18.2ms)[0m [1mCOMMIT[0m
|
504
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
505
|
+
[1m[35m (23.0ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
506
|
+
[1m[36m (8.8ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
507
|
+
[1m[35m (7.6ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
508
|
+
[1m[36m (23.6ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
509
|
+
[1m[35m (3.1ms)[0m COMMIT
|
510
|
+
[1m[36m (12.3ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
511
|
+
[1m[35m (47.4ms)[0m select * from information_schema.columns where table_name='superthings';
|
512
|
+
|
513
|
+
[1m[36m (17.3ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
514
|
+
[0m
|
515
|
+
[1m[35m (21.7ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
516
|
+
[1m[36m (16.0ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
517
|
+
[0m
|
518
|
+
[1m[35m (16.4ms)[0m select * from information_schema.columns where table_name='superthings';
|
519
|
+
|
520
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
521
|
+
[1m[35m (6.7ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
522
|
+
[1m[36m (4.3ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
523
|
+
[1m[35m (2.5ms)[0m DROP TABLE "subthing_ones"
|
524
|
+
[1m[36m (3.9ms)[0m [1mDROP TABLE "superthings"[0m
|
525
|
+
[1m[35m (8.8ms)[0m COMMIT
|
526
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
527
|
+
[1m[35m (20.0ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
528
|
+
[1m[36m (8.2ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
529
|
+
[1m[35m (18.2ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
530
|
+
[1m[36m (15.9ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
531
|
+
[1m[35m (4.4ms)[0m COMMIT
|
532
|
+
[1m[36m (19.6ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
533
|
+
[1m[35m (33.7ms)[0m select * from information_schema.columns where table_name='superthings';
|
534
|
+
|
535
|
+
[1m[36m (16.3ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
536
|
+
[0m
|
537
|
+
[1m[35m (86.1ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
538
|
+
[1m[36m (20.8ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
539
|
+
[0m
|
540
|
+
[1m[35m (17.5ms)[0m select * from information_schema.columns where table_name='superthings';
|
541
|
+
|
542
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
543
|
+
[1m[35m (7.6ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
544
|
+
[1m[36m (3.4ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
545
|
+
[1m[35m (2.9ms)[0m DROP TABLE "subthing_ones"
|
546
|
+
[1m[36m (2.7ms)[0m [1mDROP TABLE "superthings"[0m
|
547
|
+
[1m[35m (21.5ms)[0m COMMIT
|
548
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
549
|
+
[1m[35m (19.2ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
550
|
+
[1m[36m (10.9ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
551
|
+
[1m[35m (8.2ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
552
|
+
[1m[36m (25.5ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
553
|
+
[1m[35m (8.8ms)[0m COMMIT
|
554
|
+
[1m[36m (8.4ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
555
|
+
[1m[35m (32.7ms)[0m select * from information_schema.columns where table_name='superthings';
|
556
|
+
|
557
|
+
[1m[36m (15.2ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
558
|
+
[0m
|
559
|
+
[1m[35m (23.9ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
560
|
+
[1m[36m (18.0ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
561
|
+
[0m
|
562
|
+
[1m[35m (15.8ms)[0m select * from information_schema.columns where table_name='superthings';
|
563
|
+
|
564
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
565
|
+
[1m[35m (7.6ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
566
|
+
[1m[36m (2.8ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
567
|
+
[1m[35m (2.6ms)[0m DROP TABLE "subthing_ones"
|
568
|
+
[1m[36m (2.7ms)[0m [1mDROP TABLE "superthings"[0m
|
569
|
+
[1m[35m (4.2ms)[0m COMMIT
|
570
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
571
|
+
[1m[35m (23.4ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
572
|
+
[1m[36m (8.3ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
573
|
+
[1m[35m (8.3ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
574
|
+
[1m[36m (17.4ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
575
|
+
[1m[35m (3.0ms)[0m COMMIT
|
576
|
+
[1m[36m (50.7ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
577
|
+
[0m
|
578
|
+
[1m[35m (20.6ms)[0m select * from information_schema.columns where table_name='superthings';
|
579
|
+
|
580
|
+
[1m[36m (10.5ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
581
|
+
[1m[35m (22.6ms)[0m select * from information_schema.columns where table_name='superthings';
|
582
|
+
|
583
|
+
[1m[36m (16.0ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
584
|
+
[0m
|
585
|
+
[1m[35m (26.4ms)[0m select * from information_schema.columns where table_name='superthings';
|
586
|
+
|
587
|
+
[1m[36m (16.6ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
588
|
+
[1m[35m (0.5ms)[0m BEGIN
|
589
|
+
[1m[36m (5.9ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
590
|
+
[1m[35m (3.0ms)[0m DROP TABLE "subthing_twos"
|
591
|
+
[1m[36m (12.5ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
592
|
+
[1m[35m (2.7ms)[0m DROP TABLE "superthings"
|
593
|
+
[1m[36m (3.7ms)[0m [1mCOMMIT[0m
|
594
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
595
|
+
[1m[35m (13.6ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
596
|
+
[1m[36m (8.1ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
597
|
+
[1m[35m (33.1ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
598
|
+
[1m[36m (15.3ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
599
|
+
[1m[35m (9.3ms)[0m COMMIT
|
600
|
+
[1m[36m (8.5ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
601
|
+
[1m[35m (59.4ms)[0m select * from information_schema.columns where table_name='superthings';
|
602
|
+
|
603
|
+
[1m[36m (26.0ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
604
|
+
[0m
|
605
|
+
[1m[35m (17.4ms)[0m select * from information_schema.columns where table_name='superthings';
|
606
|
+
|
607
|
+
[1m[36m (20.5ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
608
|
+
[1m[35m (18.7ms)[0m select * from information_schema.columns where table_name='superthings';
|
609
|
+
|
610
|
+
[1m[36m (15.1ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
611
|
+
[0m
|
612
|
+
[1m[35m (0.6ms)[0m BEGIN
|
613
|
+
[1m[36m (13.9ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
614
|
+
[1m[35m (3.1ms)[0m DROP TABLE "subthing_twos"
|
615
|
+
[1m[36m (3.0ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
616
|
+
[1m[35m (14.4ms)[0m DROP TABLE "superthings"
|
617
|
+
[1m[36m (10.2ms)[0m [1mCOMMIT[0m
|
618
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
619
|
+
[1m[35m (22.7ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
620
|
+
[1m[36m (8.8ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
621
|
+
[1m[35m (12.7ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
622
|
+
[1m[36m (17.9ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
623
|
+
[1m[35m (7.4ms)[0m COMMIT
|
624
|
+
[1m[36m (11.2ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
625
|
+
[1m[35m (17.1ms)[0m select * from information_schema.constraint_column_usage where table_name='superthings';
|
626
|
+
|
627
|
+
[1m[36m (15.8ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
628
|
+
[1m[35m (0.7ms)[0m BEGIN
|
629
|
+
[1m[36m (5.6ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
630
|
+
[1m[35m (2.6ms)[0m DROP TABLE "subthing_twos"
|
631
|
+
[1m[36m (12.6ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
632
|
+
[1m[35m (2.5ms)[0m DROP TABLE "superthings"
|
633
|
+
[1m[36m (4.1ms)[0m [1mCOMMIT[0m
|
634
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
635
|
+
[1m[35m (11.6ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
636
|
+
[1m[36m (7.4ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
637
|
+
[1m[35m (9.9ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
638
|
+
[1m[36m (37.6ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
639
|
+
[1m[35m (3.2ms)[0m COMMIT
|
640
|
+
[1m[36m (11.2ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
641
|
+
[1m[35m (15.1ms)[0m select * from information_schema.constraint_column_usage where table_name='superthings';
|
642
|
+
|
643
|
+
[1m[36m (13.8ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
644
|
+
[1m[35m (10.2ms)[0m BEGIN
|
645
|
+
[1m[36m (5.5ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
646
|
+
[1m[35m (4.2ms)[0m DROP TABLE "subthing_twos"
|
647
|
+
[1m[36m (2.6ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
648
|
+
[1m[35m (6.8ms)[0m DROP TABLE "superthings"
|
649
|
+
[1m[36m (4.1ms)[0m [1mCOMMIT[0m
|
650
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
651
|
+
[1m[35m (1030.6ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
652
|
+
[1m[36m (329.3ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
653
|
+
[1m[35m (50.0ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
654
|
+
[1m[36m (23.1ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
655
|
+
[1m[35m (8.8ms)[0m COMMIT
|
656
|
+
[1m[36m (11.6ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
657
|
+
[1m[35m (37.8ms)[0m select * from information_schema.columns where table_name='superthings';
|
658
|
+
|
659
|
+
[1m[36m (11.2ms)[0m [1m select * from information_schema.constraint_column_usage where table_name='superthings';
|
660
|
+
[0m
|
661
|
+
[1m[35m (14.4ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
662
|
+
[1m[36m (25.7ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
663
|
+
[0m
|
664
|
+
[1m[35m (17.3ms)[0m select * from information_schema.columns where table_name='superthings';
|
665
|
+
|
666
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
667
|
+
[1m[35m (5.9ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
668
|
+
[1m[36m (2.8ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
669
|
+
[1m[35m (2.7ms)[0m DROP TABLE "subthing_ones"
|
670
|
+
[1m[36m (12.2ms)[0m [1mDROP TABLE "superthings"[0m
|
671
|
+
[1m[35m (5.0ms)[0m COMMIT
|
672
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
673
|
+
[1m[35m (120.5ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
674
|
+
[1m[36m (7.9ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
675
|
+
[1m[35m (7.5ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
676
|
+
[1m[36m (14.2ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
677
|
+
[1m[35m (2.6ms)[0m COMMIT
|
678
|
+
[1m[36m (13.5ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
679
|
+
[1m[35m (38.5ms)[0m select * from information_schema.columns where table_name='superthings';
|
680
|
+
|
681
|
+
[1m[36m (16.6ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
682
|
+
[0m
|
683
|
+
[1m[35m (10.0ms)[0m select * from information_schema.constraint_column_usage where table_name='superthings';
|
684
|
+
|
685
|
+
[1m[36m (20.7ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
686
|
+
[1m[35m (17.6ms)[0m select * from information_schema.columns where table_name='superthings';
|
687
|
+
|
688
|
+
[1m[36m (28.4ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
689
|
+
[0m
|
690
|
+
[1m[35m (0.4ms)[0m BEGIN
|
691
|
+
[1m[36m (5.9ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
692
|
+
[1m[35m (3.0ms)[0m DROP TABLE "subthing_twos"
|
693
|
+
[1m[36m (2.7ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
694
|
+
[1m[35m (2.6ms)[0m DROP TABLE "superthings"
|
695
|
+
[1m[36m (5.4ms)[0m [1mCOMMIT[0m
|
696
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
697
|
+
[1m[35m (13.9ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
698
|
+
[1m[36m (7.7ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
699
|
+
[1m[35m (7.3ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
700
|
+
[1m[36m (23.7ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
701
|
+
[1m[35m (32.9ms)[0m COMMIT
|
702
|
+
[1m[36m (10.1ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
703
|
+
[1m[35m (36.7ms)[0m select * from information_schema.columns where table_name='superthings';
|
704
|
+
|
705
|
+
[1m[36m (14.1ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
706
|
+
[0m
|
707
|
+
[1m[35m (10.2ms)[0m select * from information_schema.constraint_column_usage where table_name='superthings';
|
708
|
+
|
709
|
+
[1m[36m (13.1ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
710
|
+
[1m[35m (27.6ms)[0m select * from information_schema.columns where table_name='superthings';
|
711
|
+
|
712
|
+
[1m[36m (19.1ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
713
|
+
[0m
|
714
|
+
[1m[35m (0.4ms)[0m BEGIN
|
715
|
+
[1m[36m (18.3ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
716
|
+
[1m[35m (2.6ms)[0m DROP TABLE "subthing_twos"
|
717
|
+
[1m[36m (2.2ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
718
|
+
[1m[35m (2.0ms)[0m DROP TABLE "superthings"
|
719
|
+
[1m[36m (3.9ms)[0m [1mCOMMIT[0m
|
720
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
721
|
+
[1m[35m (11.8ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
722
|
+
[1m[36m (7.1ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
723
|
+
[1m[35m (7.0ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
724
|
+
[1m[36m (17.2ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
725
|
+
[1m[35m (11.0ms)[0m COMMIT
|
726
|
+
[1m[36m (12.3ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
727
|
+
[1m[35m (29.7ms)[0m select * from information_schema.columns where table_name='superthings';
|
728
|
+
|
729
|
+
[1m[36m (13.8ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
730
|
+
[0m
|
731
|
+
[1m[35m (8.9ms)[0m select * from information_schema.constraint_column_usage where table_name='superthings';
|
732
|
+
|
733
|
+
[1m[36m (12.7ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
734
|
+
[1m[35m (15.8ms)[0m select * from information_schema.columns where table_name='superthings';
|
735
|
+
|
736
|
+
[1m[36m (14.5ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
737
|
+
[0m
|
738
|
+
[1m[35m (0.2ms)[0m BEGIN
|
739
|
+
[1m[36m (18.1ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
740
|
+
[1m[35m (2.6ms)[0m DROP TABLE "subthing_twos"
|
741
|
+
[1m[36m (2.5ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
742
|
+
[1m[35m (2.1ms)[0m DROP TABLE "superthings"
|
743
|
+
[1m[36m (3.7ms)[0m [1mCOMMIT[0m
|
744
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
745
|
+
[1m[35m (14.4ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
746
|
+
[1m[36m (6.4ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
747
|
+
[1m[35m (9.8ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
748
|
+
[1m[36m (13.1ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
749
|
+
[1m[35m (4.0ms)[0m COMMIT
|
750
|
+
[1m[36m (10.4ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
751
|
+
[1m[35m (30.4ms)[0m select * from information_schema.columns where table_name='superthings';
|
752
|
+
|
753
|
+
[1m[36m (15.5ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
754
|
+
[0m
|
755
|
+
[1m[35m (9.1ms)[0m select * from information_schema.constraint_column_usage where table_name='superthings';
|
756
|
+
|
757
|
+
[1m[36m (14.3ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
758
|
+
[1m[35m (15.4ms)[0m select * from information_schema.columns where table_name='superthings';
|
759
|
+
|
760
|
+
[1m[36m (14.8ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
761
|
+
[0m
|
762
|
+
[1m[35m (2.3ms)[0m BEGIN
|
763
|
+
[1m[36m (11.8ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
764
|
+
[1m[35m (2.9ms)[0m DROP TABLE "subthing_twos"
|
765
|
+
[1m[36m (2.6ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
766
|
+
[1m[35m (3.5ms)[0m DROP TABLE "superthings"
|
767
|
+
[1m[36m (4.3ms)[0m [1mCOMMIT[0m
|
768
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
769
|
+
[1m[35m (68.0ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
770
|
+
[1m[36m (9.8ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
771
|
+
[1m[35m (6.4ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
772
|
+
[1m[36m (13.2ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
773
|
+
[1m[35m (2.6ms)[0m COMMIT
|
774
|
+
[1m[36m (9.3ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
775
|
+
[1m[35m (28.5ms)[0m select * from information_schema.columns where table_name='superthings';
|
776
|
+
|
777
|
+
[1m[36m (14.6ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
778
|
+
[0m
|
779
|
+
[1m[35m (10.5ms)[0m select * from information_schema.constraint_column_usage where table_name='superthings';
|
780
|
+
|
781
|
+
[1m[36m (12.1ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
782
|
+
[1m[35m (14.6ms)[0m select * from information_schema.columns where table_name='superthings';
|
783
|
+
|
784
|
+
[1m[36m (16.3ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
785
|
+
[0m
|
786
|
+
[1m[35m (0.3ms)[0m BEGIN
|
787
|
+
[1m[36m (4.7ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
788
|
+
[1m[35m (2.3ms)[0m DROP TABLE "subthing_twos"
|
789
|
+
[1m[36m (2.3ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
790
|
+
[1m[35m (2.2ms)[0m DROP TABLE "superthings"
|
791
|
+
[1m[36m (4.1ms)[0m [1mCOMMIT[0m
|
792
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
793
|
+
[1m[35m (12.5ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
794
|
+
[1m[36m (7.2ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
795
|
+
[1m[35m (7.0ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
796
|
+
[1m[36m (15.7ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
797
|
+
[1m[35m (4.3ms)[0m COMMIT
|
798
|
+
[1m[36m (8.4ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
799
|
+
[1m[35m (14.2ms)[0m select * from information_schema.constraint_column_usage where table_name='superthings';
|
800
|
+
|
801
|
+
[1m[36m (24.7ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
802
|
+
[0m
|
803
|
+
[1m[35m (14.2ms)[0m select * from information_schema.columns where table_name='superthings';
|
804
|
+
|
805
|
+
[1m[36m (11.9ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
806
|
+
[1m[35m (15.4ms)[0m select * from information_schema.columns where table_name='superthings';
|
807
|
+
|
808
|
+
[1m[36m (15.9ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
809
|
+
[0m
|
810
|
+
[1m[35m (0.2ms)[0m BEGIN
|
811
|
+
[1m[36m (4.8ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
812
|
+
[1m[35m (2.3ms)[0m DROP TABLE "subthing_twos"
|
813
|
+
[1m[36m (2.6ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
814
|
+
[1m[35m (2.3ms)[0m DROP TABLE "superthings"
|
815
|
+
[1m[36m (4.5ms)[0m [1mCOMMIT[0m
|
816
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
817
|
+
[1m[35m (12.4ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
818
|
+
[1m[36m (8.3ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
819
|
+
[1m[35m (7.2ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
820
|
+
[1m[36m (13.1ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
821
|
+
[1m[35m (2.8ms)[0m COMMIT
|
822
|
+
[1m[36m (0.8ms)[0m [1mBEGIN[0m
|
823
|
+
[1m[35m (5.5ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
824
|
+
[1m[36m (2.5ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
825
|
+
[1m[35m (2.2ms)[0m DROP TABLE "subthing_ones"
|
826
|
+
[1m[36m (2.1ms)[0m [1mDROP TABLE "superthings"[0m
|
827
|
+
[1m[35m (4.2ms)[0m COMMIT
|
828
|
+
[1m[36m (1.1ms)[0m [1mBEGIN[0m
|
829
|
+
[1m[35m (7.0ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
830
|
+
[1m[36m (7.1ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
831
|
+
[1m[35m (6.4ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
832
|
+
[1m[36m (11.1ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
833
|
+
[1m[35m (2.4ms)[0m COMMIT
|
834
|
+
[1m[36m (9.2ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
835
|
+
[1m[35m (27.2ms)[0m select * from information_schema.columns where table_name='superthings';
|
836
|
+
|
837
|
+
[1m[36m (16.0ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
838
|
+
[0m
|
839
|
+
[1m[35m (10.1ms)[0m select * from information_schema.constraint_column_usage where table_name='superthings';
|
840
|
+
|
841
|
+
[1m[36m (12.6ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
842
|
+
[1m[35m (15.0ms)[0m select * from information_schema.columns where table_name='superthings';
|
843
|
+
|
844
|
+
[1m[36m (18.1ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
845
|
+
[0m
|
846
|
+
[1m[35m (0.5ms)[0m BEGIN
|
847
|
+
[1m[36m (4.9ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
848
|
+
[1m[35m (2.1ms)[0m DROP TABLE "subthing_twos"
|
849
|
+
[1m[36m (2.0ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
850
|
+
[1m[35m (2.0ms)[0m DROP TABLE "superthings"
|
851
|
+
[1m[36m (5.8ms)[0m [1mCOMMIT[0m
|
852
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
853
|
+
[1m[35m (11.6ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
854
|
+
[1m[36m (16.6ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
855
|
+
[1m[35m (10.3ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
856
|
+
[1m[36m (13.8ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
857
|
+
[1m[35m (5.9ms)[0m ROLLBACK
|
858
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
859
|
+
[1m[35m (0.3ms)[0m ROLLBACK
|
860
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
861
|
+
[1m[35m (8.2ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
862
|
+
[1m[36m (6.8ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
863
|
+
[1m[35m (6.9ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
864
|
+
[1m[36m (13.0ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
865
|
+
[1m[35m (34.2ms)[0m ROLLBACK
|
866
|
+
[1m[36m (0.4ms)[0m [1mBEGIN[0m
|
867
|
+
[1m[35m (0.2ms)[0m ROLLBACK
|
868
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
869
|
+
[1m[35m (9.8ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
870
|
+
[1m[36m (8.6ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
871
|
+
[1m[35m (7.3ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
872
|
+
[1m[36m (13.6ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
873
|
+
[1m[35m (6.0ms)[0m ROLLBACK
|
874
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
875
|
+
[1m[35m (0.2ms)[0m ROLLBACK
|
876
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
877
|
+
[1m[35m (7.4ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
878
|
+
[1m[36m (9.6ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
879
|
+
[1m[35m (7.2ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
880
|
+
[1m[36m (13.0ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
881
|
+
[1m[35m (5.3ms)[0m ROLLBACK
|
882
|
+
[1m[36m (0.5ms)[0m [1mBEGIN[0m
|
883
|
+
[1m[35m (0.4ms)[0m ROLLBACK
|
884
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
885
|
+
[1m[35m (10.7ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
886
|
+
[1m[36m (6.4ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
887
|
+
[1m[35m (9.2ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
888
|
+
[1m[36m (12.8ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
889
|
+
[1m[35m (7.1ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
890
|
+
[1m[36m (6.8ms)[0m [1mCOMMIT[0m
|
891
|
+
[1m[35m (0.9ms)[0m BEGIN
|
892
|
+
[1m[36m (2.8ms)[0m [1mDROP TABLE "containers"[0m
|
893
|
+
[1m[35m (5.3ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
894
|
+
[1m[36m (2.2ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
895
|
+
[1m[35m (2.1ms)[0m DROP TABLE "subthing_ones"
|
896
|
+
[1m[36m (2.1ms)[0m [1mDROP TABLE "superthings"[0m
|
897
|
+
[1m[35m (4.9ms)[0m COMMIT
|
898
|
+
[1m[36m (0.5ms)[0m [1mBEGIN[0m
|
899
|
+
[1m[35m (7.6ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
900
|
+
[1m[36m (6.9ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
901
|
+
[1m[35m (7.3ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
902
|
+
[1m[36m (10.8ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
903
|
+
[1m[35m (6.7ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
904
|
+
[1m[36m (2.8ms)[0m [1mCOMMIT[0m
|
905
|
+
[1m[35m (30.4ms)[0m select * from information_schema.columns where table_name='superthings';
|
906
|
+
|
907
|
+
[1m[36m (14.6ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
908
|
+
[0m
|
909
|
+
[1m[35m (6.2ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
910
|
+
[1m[36m (18.1ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
911
|
+
[0m
|
912
|
+
[1m[35m (9.6ms)[0m select * from information_schema.constraint_column_usage where table_name='superthings';
|
913
|
+
|
914
|
+
[1m[36m (13.3ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
915
|
+
[0m
|
916
|
+
[1m[35m (12.6ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
917
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
918
|
+
[1m[35m (2.0ms)[0m DROP TABLE "containers"
|
919
|
+
[1m[36m (4.8ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
920
|
+
[1m[35m (2.0ms)[0m DROP TABLE "subthing_twos"
|
921
|
+
[1m[36m (2.3ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
922
|
+
[1m[35m (2.2ms)[0m DROP TABLE "superthings"
|
923
|
+
[1m[36m (4.4ms)[0m [1mCOMMIT[0m
|
924
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
925
|
+
[1m[35m (10.8ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
926
|
+
[1m[36m (7.9ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
927
|
+
[1m[35m (7.7ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
928
|
+
[1m[36m (12.8ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
929
|
+
[1m[35m (7.0ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
930
|
+
[1m[36m (4.9ms)[0m [1mCOMMIT[0m
|
931
|
+
[1m[35m (0.9ms)[0m BEGIN
|
932
|
+
[1m[36m (2.7ms)[0m [1mDROP TABLE "containers"[0m
|
933
|
+
[1m[35m (5.6ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
934
|
+
[1m[36m (2.1ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
935
|
+
[1m[35m (2.6ms)[0m DROP TABLE "subthing_ones"
|
936
|
+
[1m[36m (2.3ms)[0m [1mDROP TABLE "superthings"[0m
|
937
|
+
[1m[35m (4.2ms)[0m COMMIT
|
938
|
+
[1m[36m (1.2ms)[0m [1mBEGIN[0m
|
939
|
+
[1m[35m (7.9ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
940
|
+
[1m[36m (9.1ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
941
|
+
[1m[35m (6.4ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
942
|
+
[1m[36m (11.8ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
943
|
+
[1m[35m (7.5ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
944
|
+
[1m[36m (3.1ms)[0m [1mCOMMIT[0m
|
945
|
+
[1m[35m (8.3ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
946
|
+
[1m[36m (13.9ms)[0m [1m select * from information_schema.constraint_column_usage where table_name='superthings';
|
947
|
+
[0m
|
948
|
+
[1m[35m (25.2ms)[0m select * from information_schema.columns where table_name='superthings';
|
949
|
+
|
950
|
+
[1m[36m (13.5ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
951
|
+
[0m
|
952
|
+
[1m[35m (12.4ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
953
|
+
[1m[36m (17.0ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
954
|
+
[0m
|
955
|
+
[1m[35m (14.9ms)[0m select * from information_schema.columns where table_name='superthings';
|
956
|
+
|
957
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
958
|
+
[1m[35m (3.1ms)[0m DROP TABLE "containers"
|
959
|
+
[1m[36m (4.9ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
960
|
+
[1m[35m (2.0ms)[0m DROP TABLE "subthing_twos"
|
961
|
+
[1m[36m (2.1ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
962
|
+
[1m[35m (2.1ms)[0m DROP TABLE "superthings"
|
963
|
+
[1m[36m (4.1ms)[0m [1mCOMMIT[0m
|
964
|
+
[1m[36m (0.4ms)[0m [1mBEGIN[0m
|
965
|
+
[1m[35m (13.3ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
966
|
+
[1m[36m (7.6ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
967
|
+
[1m[35m (12.1ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
968
|
+
[1m[36m (22.7ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
969
|
+
[1m[35m (11.6ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
970
|
+
[1m[36m (9.9ms)[0m [1mCOMMIT[0m
|
971
|
+
[1m[35m (1.7ms)[0m BEGIN
|
972
|
+
[1m[36m (3.9ms)[0m [1mDROP TABLE "containers"[0m
|
973
|
+
[1m[35m (13.4ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
974
|
+
[1m[36m (4.3ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
975
|
+
[1m[35m (3.1ms)[0m DROP TABLE "subthing_ones"
|
976
|
+
[1m[36m (3.0ms)[0m [1mDROP TABLE "superthings"[0m
|
977
|
+
[1m[35m (5.0ms)[0m COMMIT
|
978
|
+
[1m[36m (1.0ms)[0m [1mBEGIN[0m
|
979
|
+
[1m[35m (11.4ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
980
|
+
[1m[36m (8.1ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
981
|
+
[1m[35m (7.4ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
982
|
+
[1m[36m (13.8ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
983
|
+
[1m[35m (7.4ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
984
|
+
[1m[36m (4.4ms)[0m [1mCOMMIT[0m
|
985
|
+
[1m[35m (7.6ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
986
|
+
[1m[36m (37.9ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
987
|
+
[0m
|
988
|
+
[1m[35m (14.8ms)[0m select * from information_schema.columns where table_name='superthings';
|
989
|
+
|
990
|
+
[1m[36m (9.9ms)[0m [1m select * from information_schema.constraint_column_usage where table_name='superthings';
|
991
|
+
[0m
|
992
|
+
[1m[35m (14.1ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
993
|
+
[1m[36m (16.2ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
994
|
+
[0m
|
995
|
+
[1m[35m (32.8ms)[0m select * from information_schema.columns where table_name='superthings';
|
996
|
+
|
997
|
+
[1m[36m (0.4ms)[0m [1mBEGIN[0m
|
998
|
+
[1m[35m (4.0ms)[0m DROP TABLE "containers"
|
999
|
+
[1m[36m (7.1ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
1000
|
+
[1m[35m (2.7ms)[0m DROP TABLE "subthing_twos"
|
1001
|
+
[1m[36m (3.9ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
1002
|
+
[1m[35m (3.3ms)[0m DROP TABLE "superthings"
|
1003
|
+
[1m[36m (9.2ms)[0m [1mCOMMIT[0m
|
1004
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1005
|
+
[1m[35m (11.3ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1006
|
+
[1m[36m (6.5ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1007
|
+
[1m[35m (7.4ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1008
|
+
[1m[36m (27.1ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1009
|
+
[1m[35m (21.5ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1010
|
+
[1m[36m (4.1ms)[0m [1mCOMMIT[0m
|
1011
|
+
[1m[35m (1.4ms)[0m BEGIN
|
1012
|
+
[1m[36m (2.9ms)[0m [1mDROP TABLE "containers"[0m
|
1013
|
+
[1m[35m (6.3ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1014
|
+
[1m[36m (2.5ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
1015
|
+
[1m[35m (2.5ms)[0m DROP TABLE "subthing_ones"
|
1016
|
+
[1m[36m (2.4ms)[0m [1mDROP TABLE "superthings"[0m
|
1017
|
+
[1m[35m (10.4ms)[0m COMMIT
|
1018
|
+
[1m[36m (0.5ms)[0m [1mBEGIN[0m
|
1019
|
+
[1m[35m (8.8ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1020
|
+
[1m[36m (12.4ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1021
|
+
[1m[35m (7.6ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1022
|
+
[1m[36m (17.0ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1023
|
+
[1m[35m (8.4ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1024
|
+
[1m[36m (10.6ms)[0m [1mCOMMIT[0m
|
1025
|
+
[1m[35m (14.8ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1026
|
+
[1m[36m (31.3ms)[0m [1m select * from information_schema.constraint_column_usage where table_name='superthings';
|
1027
|
+
[0m
|
1028
|
+
[1m[35m (36.1ms)[0m select * from information_schema.columns where table_name='superthings';
|
1029
|
+
|
1030
|
+
[1m[36m (14.5ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1031
|
+
[0m
|
1032
|
+
[1m[35m (24.1ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
1033
|
+
[1m[36m (16.4ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1034
|
+
[0m
|
1035
|
+
[1m[35m (23.1ms)[0m select * from information_schema.columns where table_name='superthings';
|
1036
|
+
|
1037
|
+
[1m[36m (0.4ms)[0m [1mBEGIN[0m
|
1038
|
+
[1m[35m (2.6ms)[0m DROP TABLE "containers"
|
1039
|
+
[1m[36m (5.3ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
1040
|
+
[1m[35m (2.2ms)[0m DROP TABLE "subthing_twos"
|
1041
|
+
[1m[36m (2.2ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
1042
|
+
[1m[35m (2.8ms)[0m DROP TABLE "superthings"
|
1043
|
+
[1m[36m (24.3ms)[0m [1mCOMMIT[0m
|
1044
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1045
|
+
[1m[35m (13.1ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1046
|
+
[1m[36m (6.8ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1047
|
+
[1m[35m (7.3ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1048
|
+
[1m[36m (19.2ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1049
|
+
[1m[35m (7.6ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1050
|
+
[1m[36m (5.3ms)[0m [1mCOMMIT[0m
|
1051
|
+
[1m[35m (31.5ms)[0m select * from information_schema.columns where table_name='superthings';
|
1052
|
+
|
1053
|
+
[1m[36m (14.0ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1054
|
+
[0m
|
1055
|
+
[1m[35m (7.0ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1056
|
+
[1m[36m (9.3ms)[0m [1m select * from information_schema.constraint_column_usage where table_name='superthings';
|
1057
|
+
[0m
|
1058
|
+
[1m[35m (14.6ms)[0m select * from information_schema.columns where table_name='superthings';
|
1059
|
+
|
1060
|
+
[1m[36m (13.1ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1061
|
+
[0m
|
1062
|
+
[1m[35m (12.9ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
1063
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
1064
|
+
[1m[35m (3.4ms)[0m DROP TABLE "containers"
|
1065
|
+
[1m[36m (6.2ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
1066
|
+
[1m[35m (2.3ms)[0m DROP TABLE "subthing_twos"
|
1067
|
+
[1m[36m (2.1ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
1068
|
+
[1m[35m (2.0ms)[0m DROP TABLE "superthings"
|
1069
|
+
[1m[36m (4.2ms)[0m [1mCOMMIT[0m
|
1070
|
+
[1m[35m (1.0ms)[0m BEGIN
|
1071
|
+
[1m[36m (6.7ms)[0m [1mCREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1072
|
+
[1m[35m (8.0ms)[0m CREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1073
|
+
[1m[36m (14.7ms)[0m [1mCREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1074
|
+
[1m[35m (13.1ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
1075
|
+
[1m[36m (7.5ms)[0m [1mCREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1076
|
+
[1m[35m (3.8ms)[0m COMMIT
|
1077
|
+
[1m[36m (1.1ms)[0m [1mBEGIN[0m
|
1078
|
+
[1m[35m (2.4ms)[0m DROP TABLE "containers"
|
1079
|
+
[1m[36m (5.7ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
1080
|
+
[1m[35m (2.5ms)[0m DROP TABLE "subthing_twos"
|
1081
|
+
[1m[36m (2.4ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
1082
|
+
[1m[35m (2.5ms)[0m DROP TABLE "superthings"
|
1083
|
+
[1m[36m (4.1ms)[0m [1mCOMMIT[0m
|
1084
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1085
|
+
[1m[35m (10.7ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1086
|
+
[1m[36m (8.9ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1087
|
+
[1m[35m (8.3ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1088
|
+
[1m[36m (14.5ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1089
|
+
[1m[35m (8.1ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1090
|
+
[1m[36m (3.1ms)[0m [1mCOMMIT[0m
|
1091
|
+
[1m[35m (1.7ms)[0m BEGIN
|
1092
|
+
[1m[36m (3.0ms)[0m [1mDROP TABLE "containers"[0m
|
1093
|
+
[1m[35m (5.2ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1094
|
+
[1m[36m (2.1ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
1095
|
+
[1m[35m (2.1ms)[0m DROP TABLE "subthing_ones"
|
1096
|
+
[1m[36m (2.0ms)[0m [1mDROP TABLE "superthings"[0m
|
1097
|
+
[1m[35m (4.6ms)[0m COMMIT
|
1098
|
+
[1m[36m (0.8ms)[0m [1mBEGIN[0m
|
1099
|
+
[1m[35m (6.7ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1100
|
+
[1m[36m (9.1ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1101
|
+
[1m[35m (7.5ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1102
|
+
[1m[36m (12.2ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1103
|
+
[1m[35m (8.0ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1104
|
+
[1m[36m (3.3ms)[0m [1mCOMMIT[0m
|
1105
|
+
[1m[35m (7.9ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1106
|
+
[1m[36m (40.5ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1107
|
+
[0m
|
1108
|
+
[1m[35m (14.2ms)[0m select * from information_schema.columns where table_name='superthings';
|
1109
|
+
|
1110
|
+
[1m[36m (9.7ms)[0m [1m select * from information_schema.constraint_column_usage where table_name='superthings';
|
1111
|
+
[0m
|
1112
|
+
[1m[35m (13.3ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
1113
|
+
[1m[36m (17.5ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1114
|
+
[0m
|
1115
|
+
[1m[35m (13.8ms)[0m select * from information_schema.columns where table_name='superthings';
|
1116
|
+
|
1117
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1118
|
+
[1m[35m (2.1ms)[0m DROP TABLE "containers"
|
1119
|
+
[1m[36m (6.0ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
1120
|
+
[1m[35m (2.6ms)[0m DROP TABLE "subthing_twos"
|
1121
|
+
[1m[36m (2.2ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
1122
|
+
[1m[35m (2.1ms)[0m DROP TABLE "superthings"
|
1123
|
+
[1m[36m (4.2ms)[0m [1mCOMMIT[0m
|
1124
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1125
|
+
[1m[35m (13.5ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1126
|
+
[1m[36m (8.2ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1127
|
+
[1m[35m (6.7ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1128
|
+
[1m[36m (14.2ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1129
|
+
[1m[35m (8.4ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1130
|
+
[1m[36m (5.4ms)[0m [1mCOMMIT[0m
|
1131
|
+
[1m[35m (0.9ms)[0m BEGIN
|
1132
|
+
[1m[36m (3.0ms)[0m [1mDROP TABLE "containers"[0m
|
1133
|
+
[1m[35m (6.0ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1134
|
+
[1m[36m (2.3ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
1135
|
+
[1m[35m (2.2ms)[0m DROP TABLE "subthing_ones"
|
1136
|
+
[1m[36m (2.0ms)[0m [1mDROP TABLE "superthings"[0m
|
1137
|
+
[1m[35m (4.6ms)[0m COMMIT
|
1138
|
+
[1m[36m (0.5ms)[0m [1mBEGIN[0m
|
1139
|
+
[1m[35m (6.8ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1140
|
+
[1m[36m (7.2ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1141
|
+
[1m[35m (7.8ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1142
|
+
[1m[36m (12.6ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1143
|
+
[1m[35m (7.1ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1144
|
+
[1m[36m (4.9ms)[0m [1mCOMMIT[0m
|
1145
|
+
[1m[35m (16.4ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1146
|
+
[1m[36m (28.8ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1147
|
+
[0m
|
1148
|
+
[1m[35m (15.9ms)[0m select * from information_schema.columns where table_name='superthings';
|
1149
|
+
|
1150
|
+
[1m[36m (9.4ms)[0m [1m select * from information_schema.constraint_column_usage where table_name='superthings';
|
1151
|
+
[0m
|
1152
|
+
[1m[35m (11.9ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
1153
|
+
[1m[36m (16.2ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1154
|
+
[0m
|
1155
|
+
[1m[35m (13.9ms)[0m select * from information_schema.columns where table_name='superthings';
|
1156
|
+
|
1157
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1158
|
+
[1m[35m (2.1ms)[0m DROP TABLE "containers"
|
1159
|
+
[1m[36m (5.2ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
1160
|
+
[1m[35m (2.2ms)[0m DROP TABLE "subthing_twos"
|
1161
|
+
[1m[36m (2.3ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
1162
|
+
[1m[35m (2.7ms)[0m DROP TABLE "superthings"
|
1163
|
+
[1m[36m (13.8ms)[0m [1mCOMMIT[0m
|
1164
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1165
|
+
[1m[35m (10.6ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1166
|
+
[1m[36m (6.5ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1167
|
+
[1m[35m (10.0ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1168
|
+
[1m[36m (18.5ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1169
|
+
[1m[35m (11.1ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1170
|
+
[1m[36m (3.9ms)[0m [1mCOMMIT[0m
|
1171
|
+
[1m[35m (32.1ms)[0m select * from information_schema.columns where table_name='superthings';
|
1172
|
+
|
1173
|
+
[1m[36m (15.4ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1174
|
+
[0m
|
1175
|
+
[1m[35m (6.8ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1176
|
+
[1m[36m (9.9ms)[0m [1m select * from information_schema.constraint_column_usage where table_name='superthings';
|
1177
|
+
[0m
|
1178
|
+
[1m[35m (13.9ms)[0m select * from information_schema.columns where table_name='superthings';
|
1179
|
+
|
1180
|
+
[1m[36m (15.1ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1181
|
+
[0m
|
1182
|
+
[1m[35m (12.5ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
1183
|
+
[1m[36m (0.3ms)[0m [1mBEGIN[0m
|
1184
|
+
[1m[35m (2.5ms)[0m DROP TABLE "containers"
|
1185
|
+
[1m[36m (4.9ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
1186
|
+
[1m[35m (2.1ms)[0m DROP TABLE "subthing_twos"
|
1187
|
+
[1m[36m (2.1ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
1188
|
+
[1m[35m (2.0ms)[0m DROP TABLE "superthings"
|
1189
|
+
[1m[36m (4.0ms)[0m [1mCOMMIT[0m
|
1190
|
+
[1m[35m (0.9ms)[0m BEGIN
|
1191
|
+
[1m[36m (8.2ms)[0m [1mCREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1192
|
+
[1m[35m (9.6ms)[0m CREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1193
|
+
[1m[36m (9.3ms)[0m [1mCREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1194
|
+
[1m[35m (12.6ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
1195
|
+
[1m[36m (49.7ms)[0m [1mCREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1196
|
+
[1m[35m (2.9ms)[0m COMMIT
|
1197
|
+
[1m[36m (2.0ms)[0m [1mBEGIN[0m
|
1198
|
+
[1m[35m (2.4ms)[0m DROP TABLE "containers"
|
1199
|
+
[1m[36m (5.9ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
1200
|
+
[1m[35m (2.4ms)[0m DROP TABLE "subthing_twos"
|
1201
|
+
[1m[36m (2.3ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
1202
|
+
[1m[35m (2.2ms)[0m DROP TABLE "superthings"
|
1203
|
+
[1m[36m (4.6ms)[0m [1mCOMMIT[0m
|
1204
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1205
|
+
[1m[35m (10.9ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1206
|
+
[1m[36m (7.1ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1207
|
+
[1m[35m (10.6ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1208
|
+
[1m[36m (23.7ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1209
|
+
[1m[35m (9.0ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1210
|
+
[1m[36m (3.3ms)[0m [1mCOMMIT[0m
|
1211
|
+
[1m[35m (1.3ms)[0m BEGIN
|
1212
|
+
[1m[36m (2.9ms)[0m [1mDROP TABLE "containers"[0m
|
1213
|
+
[1m[35m (5.9ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1214
|
+
[1m[36m (2.3ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
1215
|
+
[1m[35m (3.2ms)[0m DROP TABLE "subthing_ones"
|
1216
|
+
[1m[36m (2.3ms)[0m [1mDROP TABLE "superthings"[0m
|
1217
|
+
[1m[35m (6.8ms)[0m COMMIT
|
1218
|
+
[1m[36m (0.7ms)[0m [1mBEGIN[0m
|
1219
|
+
[1m[35m (9.2ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1220
|
+
[1m[36m (8.0ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1221
|
+
[1m[35m (6.8ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1222
|
+
[1m[36m (15.1ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1223
|
+
[1m[35m (7.1ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1224
|
+
[1m[36m (3.2ms)[0m [1mCOMMIT[0m
|
1225
|
+
[1m[35m (8.1ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1226
|
+
[1m[36m (22.9ms)[0m [1m select * from information_schema.constraint_column_usage where table_name='superthings';
|
1227
|
+
[0m
|
1228
|
+
[1m[35m (24.1ms)[0m select * from information_schema.columns where table_name='superthings';
|
1229
|
+
|
1230
|
+
[1m[36m (15.0ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1231
|
+
[0m
|
1232
|
+
[1m[35m (15.9ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
1233
|
+
[1m[36m (14.0ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1234
|
+
[0m
|
1235
|
+
[1m[35m (15.4ms)[0m select * from information_schema.columns where table_name='superthings';
|
1236
|
+
|
1237
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1238
|
+
[1m[35m (2.1ms)[0m DROP TABLE "containers"
|
1239
|
+
[1m[36m (6.1ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
1240
|
+
[1m[35m (2.2ms)[0m DROP TABLE "subthing_twos"
|
1241
|
+
[1m[36m (2.0ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
1242
|
+
[1m[35m (2.0ms)[0m DROP TABLE "superthings"
|
1243
|
+
[1m[36m (4.0ms)[0m [1mCOMMIT[0m
|
1244
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1245
|
+
[1m[35m (11.0ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1246
|
+
[1m[36m (6.8ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1247
|
+
[1m[35m (6.9ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1248
|
+
[1m[36m (25.0ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1249
|
+
[1m[35m (7.6ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1250
|
+
[1m[36m (3.2ms)[0m [1mCOMMIT[0m
|
1251
|
+
[1m[35m (1.2ms)[0m BEGIN
|
1252
|
+
[1m[36m (2.9ms)[0m [1mDROP TABLE "containers"[0m
|
1253
|
+
[1m[35m (5.4ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1254
|
+
[1m[36m (2.6ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
1255
|
+
[1m[35m (2.1ms)[0m DROP TABLE "subthing_ones"
|
1256
|
+
[1m[36m (2.3ms)[0m [1mDROP TABLE "superthings"[0m
|
1257
|
+
[1m[35m (4.7ms)[0m COMMIT
|
1258
|
+
[1m[36m (0.5ms)[0m [1mBEGIN[0m
|
1259
|
+
[1m[35m (6.7ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1260
|
+
[1m[36m (6.6ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1261
|
+
[1m[35m (6.3ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1262
|
+
[1m[36m (12.0ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1263
|
+
[1m[35m (7.6ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1264
|
+
[1m[36m (3.0ms)[0m [1mCOMMIT[0m
|
1265
|
+
[1m[35m (9.2ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1266
|
+
[1m[36m (29.1ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1267
|
+
[0m
|
1268
|
+
[1m[35m (13.4ms)[0m select * from information_schema.columns where table_name='superthings';
|
1269
|
+
|
1270
|
+
[1m[36m (9.0ms)[0m [1m select * from information_schema.constraint_column_usage where table_name='superthings';
|
1271
|
+
[0m
|
1272
|
+
[1m[35m (14.0ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
1273
|
+
[1m[36m (19.8ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1274
|
+
[0m
|
1275
|
+
[1m[35m (15.0ms)[0m select * from information_schema.columns where table_name='superthings';
|
1276
|
+
|
1277
|
+
[1m[36m (0.5ms)[0m [1mBEGIN[0m
|
1278
|
+
[1m[35m (5.3ms)[0m DROP TABLE "containers"
|
1279
|
+
[1m[36m (6.1ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
1280
|
+
[1m[35m (2.5ms)[0m DROP TABLE "subthing_twos"
|
1281
|
+
[1m[36m (2.2ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
1282
|
+
[1m[35m (2.6ms)[0m DROP TABLE "superthings"
|
1283
|
+
[1m[36m (4.7ms)[0m [1mCOMMIT[0m
|
1284
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
1285
|
+
[1m[35m (14.5ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1286
|
+
[1m[36m (7.1ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1287
|
+
[1m[35m (7.9ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1288
|
+
[1m[36m (21.6ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1289
|
+
[1m[35m (8.1ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1290
|
+
[1m[36m (5.3ms)[0m [1mCOMMIT[0m
|
1291
|
+
[1m[35m (2.9ms)[0m BEGIN
|
1292
|
+
[1m[36m (3.3ms)[0m [1mDROP TABLE "containers"[0m
|
1293
|
+
[1m[35m (5.4ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1294
|
+
[1m[36m (2.2ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
1295
|
+
[1m[35m (2.2ms)[0m DROP TABLE "subthing_ones"
|
1296
|
+
[1m[36m (3.0ms)[0m [1mDROP TABLE "superthings"[0m
|
1297
|
+
[1m[35m (4.6ms)[0m COMMIT
|
1298
|
+
[1m[36m (0.6ms)[0m [1mBEGIN[0m
|
1299
|
+
[1m[35m (8.0ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1300
|
+
[1m[36m (9.9ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1301
|
+
[1m[35m (7.2ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1302
|
+
[1m[36m (11.9ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1303
|
+
[1m[35m (6.9ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1304
|
+
[1m[36m (4.2ms)[0m [1mCOMMIT[0m
|
1305
|
+
[1m[35m (7.6ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1306
|
+
[1m[36m (19.7ms)[0m [1m select * from information_schema.constraint_column_usage where table_name='superthings';
|
1307
|
+
[0m
|
1308
|
+
[1m[35m (24.3ms)[0m select * from information_schema.columns where table_name='superthings';
|
1309
|
+
|
1310
|
+
[1m[36m (14.6ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1311
|
+
[0m
|
1312
|
+
[1m[35m (13.4ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
1313
|
+
[1m[36m (14.2ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1314
|
+
[0m
|
1315
|
+
[1m[35m (15.4ms)[0m select * from information_schema.columns where table_name='superthings';
|
1316
|
+
|
1317
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1318
|
+
[1m[35m (9.3ms)[0m DROP TABLE "containers"
|
1319
|
+
[1m[36m (6.9ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
1320
|
+
[1m[35m (3.4ms)[0m DROP TABLE "subthing_twos"
|
1321
|
+
[1m[36m (2.3ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
1322
|
+
[1m[35m (2.4ms)[0m DROP TABLE "superthings"
|
1323
|
+
[1m[36m (60.5ms)[0m [1mCOMMIT[0m
|
1324
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1325
|
+
[1m[35m (10.5ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1326
|
+
[1m[36m (18.9ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1327
|
+
[1m[35m (13.2ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1328
|
+
[1m[36m (13.6ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1329
|
+
[1m[35m (8.3ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1330
|
+
[1m[36m (3.9ms)[0m [1mCOMMIT[0m
|
1331
|
+
[1m[35m (2.0ms)[0m BEGIN
|
1332
|
+
[1m[36m (2.8ms)[0m [1mDROP TABLE "containers"[0m
|
1333
|
+
[1m[35m (5.6ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1334
|
+
[1m[36m (2.4ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
1335
|
+
[1m[35m (3.2ms)[0m DROP TABLE "subthing_ones"
|
1336
|
+
[1m[36m (2.4ms)[0m [1mDROP TABLE "superthings"[0m
|
1337
|
+
[1m[35m (4.4ms)[0m COMMIT
|
1338
|
+
[1m[36m (0.6ms)[0m [1mBEGIN[0m
|
1339
|
+
[1m[35m (11.0ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1340
|
+
[1m[36m (12.3ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1341
|
+
[1m[35m (7.8ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1342
|
+
[1m[36m (13.4ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1343
|
+
[1m[35m (7.2ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1344
|
+
[1m[36m (2.9ms)[0m [1mCOMMIT[0m
|
1345
|
+
[1m[35m (7.7ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1346
|
+
[1m[36m (40.6ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1347
|
+
[0m
|
1348
|
+
[1m[35m (14.7ms)[0m select * from information_schema.columns where table_name='superthings';
|
1349
|
+
|
1350
|
+
[1m[36m (8.8ms)[0m [1m select * from information_schema.constraint_column_usage where table_name='superthings';
|
1351
|
+
[0m
|
1352
|
+
[1m[35m (11.8ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
1353
|
+
[1m[36m (17.1ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1354
|
+
[0m
|
1355
|
+
[1m[35m (13.8ms)[0m select * from information_schema.columns where table_name='superthings';
|
1356
|
+
|
1357
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1358
|
+
[1m[35m (2.4ms)[0m DROP TABLE "containers"
|
1359
|
+
[1m[36m (4.8ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
1360
|
+
[1m[35m (2.0ms)[0m DROP TABLE "subthing_twos"
|
1361
|
+
[1m[36m (2.0ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
1362
|
+
[1m[35m (3.0ms)[0m DROP TABLE "superthings"
|
1363
|
+
[1m[36m (14.6ms)[0m [1mCOMMIT[0m
|
1364
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1365
|
+
[1m[35m (13.4ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1366
|
+
[1m[36m (8.1ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1367
|
+
[1m[35m (6.8ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1368
|
+
[1m[36m (13.8ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1369
|
+
[1m[35m (9.6ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1370
|
+
[1m[36m (4.1ms)[0m [1mCOMMIT[0m
|
1371
|
+
[1m[35m (31.6ms)[0m select * from information_schema.columns where table_name='superthings';
|
1372
|
+
|
1373
|
+
[1m[36m (16.6ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1374
|
+
[0m
|
1375
|
+
[1m[35m (7.2ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1376
|
+
[1m[36m (14.0ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1377
|
+
[0m
|
1378
|
+
[1m[35m (9.4ms)[0m select * from information_schema.constraint_column_usage where table_name='superthings';
|
1379
|
+
|
1380
|
+
[1m[36m (13.1ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1381
|
+
[0m
|
1382
|
+
[1m[35m (12.0ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
1383
|
+
[1m[36m (0.4ms)[0m [1mBEGIN[0m
|
1384
|
+
[1m[35m (2.8ms)[0m DROP TABLE "containers"
|
1385
|
+
[1m[36m (4.8ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
1386
|
+
[1m[35m (2.1ms)[0m DROP TABLE "subthing_twos"
|
1387
|
+
[1m[36m (2.0ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
1388
|
+
[1m[35m (2.1ms)[0m DROP TABLE "superthings"
|
1389
|
+
[1m[36m (3.9ms)[0m [1mCOMMIT[0m
|
1390
|
+
[1m[35m (0.8ms)[0m BEGIN
|
1391
|
+
[1m[36m (8.9ms)[0m [1mCREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1392
|
+
[1m[35m (9.6ms)[0m CREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1393
|
+
[1m[36m (6.7ms)[0m [1mCREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1394
|
+
[1m[35m (14.0ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
1395
|
+
[1m[36m (7.3ms)[0m [1mCREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1396
|
+
[1m[35m (3.6ms)[0m COMMIT
|
1397
|
+
[1m[36m (2.3ms)[0m [1mBEGIN[0m
|
1398
|
+
[1m[35m (2.5ms)[0m DROP TABLE "containers"
|
1399
|
+
[1m[36m (5.5ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
1400
|
+
[1m[35m (2.4ms)[0m DROP TABLE "subthing_twos"
|
1401
|
+
[1m[36m (2.8ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
1402
|
+
[1m[35m (2.6ms)[0m DROP TABLE "superthings"
|
1403
|
+
[1m[36m (3.9ms)[0m [1mCOMMIT[0m
|
1404
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1405
|
+
[1m[35m (12.3ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1406
|
+
[1m[36m (11.5ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1407
|
+
[1m[35m (6.9ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1408
|
+
[1m[36m (14.5ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1409
|
+
[1m[35m (9.0ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1410
|
+
[1m[36m (5.3ms)[0m [1mCOMMIT[0m
|
1411
|
+
[1m[35m (3.3ms)[0m BEGIN
|
1412
|
+
[1m[36m (3.2ms)[0m [1mDROP TABLE "containers"[0m
|
1413
|
+
[1m[35m (6.5ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1414
|
+
[1m[36m (2.4ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
1415
|
+
[1m[35m (2.3ms)[0m DROP TABLE "subthing_ones"
|
1416
|
+
[1m[36m (2.3ms)[0m [1mDROP TABLE "superthings"[0m
|
1417
|
+
[1m[35m (4.7ms)[0m COMMIT
|
1418
|
+
[1m[36m (0.6ms)[0m [1mBEGIN[0m
|
1419
|
+
[1m[35m (9.8ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1420
|
+
[1m[36m (18.1ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1421
|
+
[1m[35m (9.4ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1422
|
+
[1m[36m (20.0ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1423
|
+
[1m[35m (12.0ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1424
|
+
[1m[36m (3.8ms)[0m [1mCOMMIT[0m
|
1425
|
+
[1m[35m (8.5ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1426
|
+
[1m[36m (17.8ms)[0m [1m select * from information_schema.constraint_column_usage where table_name='superthings';
|
1427
|
+
[0m
|
1428
|
+
[1m[35m (25.7ms)[0m select * from information_schema.columns where table_name='superthings';
|
1429
|
+
|
1430
|
+
[1m[36m (15.1ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1431
|
+
[0m
|
1432
|
+
[1m[35m (58.6ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
1433
|
+
[1m[36m (18.5ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1434
|
+
[0m
|
1435
|
+
[1m[35m (14.7ms)[0m select * from information_schema.columns where table_name='superthings';
|
1436
|
+
|
1437
|
+
[1m[36m (1.6ms)[0m [1mBEGIN[0m
|
1438
|
+
[1m[35m (2.2ms)[0m DROP TABLE "containers"
|
1439
|
+
[1m[36m (5.3ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
1440
|
+
[1m[35m (2.8ms)[0m DROP TABLE "subthing_twos"
|
1441
|
+
[1m[36m (2.9ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
1442
|
+
[1m[35m (2.3ms)[0m DROP TABLE "superthings"
|
1443
|
+
[1m[36m (4.1ms)[0m [1mCOMMIT[0m
|
1444
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1445
|
+
[1m[35m (13.0ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1446
|
+
[1m[36m (19.6ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1447
|
+
[1m[35m (9.8ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1448
|
+
[1m[36m (17.5ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1449
|
+
[1m[35m (9.9ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1450
|
+
[1m[36m (3.9ms)[0m [1mCOMMIT[0m
|
1451
|
+
[1m[35m (1.3ms)[0m BEGIN
|
1452
|
+
[1m[36m (2.9ms)[0m [1mDROP TABLE "containers"[0m
|
1453
|
+
[1m[35m (5.2ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1454
|
+
[1m[36m (3.0ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
1455
|
+
[1m[35m (2.2ms)[0m DROP TABLE "subthing_ones"
|
1456
|
+
[1m[36m (4.1ms)[0m [1mDROP TABLE "superthings"[0m
|
1457
|
+
[1m[35m (4.8ms)[0m COMMIT
|
1458
|
+
[1m[36m (2.5ms)[0m [1mBEGIN[0m
|
1459
|
+
[1m[35m (8.0ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1460
|
+
[1m[36m (9.3ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1461
|
+
[1m[35m (9.9ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1462
|
+
[1m[36m (13.9ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1463
|
+
[1m[35m (7.8ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1464
|
+
[1m[36m (5.6ms)[0m [1mCOMMIT[0m
|
1465
|
+
[1m[35m (9.2ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1466
|
+
[1m[36m (29.0ms)[0m [1m select * from information_schema.constraint_column_usage where table_name='superthings';
|
1467
|
+
[0m
|
1468
|
+
[1m[35m (22.7ms)[0m select * from information_schema.columns where table_name='superthings';
|
1469
|
+
|
1470
|
+
[1m[36m (15.9ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1471
|
+
[0m
|
1472
|
+
[1m[35m (16.9ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
1473
|
+
[1m[36m (15.5ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1474
|
+
[0m
|
1475
|
+
[1m[35m (22.6ms)[0m select * from information_schema.columns where table_name='superthings';
|
1476
|
+
|
1477
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1478
|
+
[1m[35m (2.2ms)[0m DROP TABLE "containers"
|
1479
|
+
[1m[36m (4.9ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
1480
|
+
[1m[35m (2.0ms)[0m DROP TABLE "subthing_twos"
|
1481
|
+
[1m[36m (3.4ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
1482
|
+
[1m[35m (3.0ms)[0m DROP TABLE "superthings"
|
1483
|
+
[1m[36m (4.8ms)[0m [1mCOMMIT[0m
|
1484
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1485
|
+
[1m[35m (13.5ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1486
|
+
[1m[36m (8.6ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1487
|
+
[1m[35m (6.8ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1488
|
+
[1m[36m (14.4ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1489
|
+
[1m[35m (12.2ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1490
|
+
[1m[36m (6.1ms)[0m [1mCOMMIT[0m
|
1491
|
+
[1m[35m (1.7ms)[0m BEGIN
|
1492
|
+
[1m[36m (3.1ms)[0m [1mDROP TABLE "containers"[0m
|
1493
|
+
[1m[35m (5.0ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1494
|
+
[1m[36m (2.1ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
1495
|
+
[1m[35m (2.0ms)[0m DROP TABLE "subthing_ones"
|
1496
|
+
[1m[36m (2.3ms)[0m [1mDROP TABLE "superthings"[0m
|
1497
|
+
[1m[35m (5.1ms)[0m COMMIT
|
1498
|
+
[1m[36m (0.7ms)[0m [1mBEGIN[0m
|
1499
|
+
[1m[35m (7.0ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1500
|
+
[1m[36m (9.4ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1501
|
+
[1m[35m (7.1ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1502
|
+
[1m[36m (13.9ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1503
|
+
[1m[35m (7.3ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1504
|
+
[1m[36m (3.7ms)[0m [1mCOMMIT[0m
|
1505
|
+
[1m[35m (9.5ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1506
|
+
[1m[36m (20.0ms)[0m [1m select * from information_schema.constraint_column_usage where table_name='superthings';
|
1507
|
+
[0m
|
1508
|
+
[1m[35m (26.0ms)[0m select * from information_schema.columns where table_name='superthings';
|
1509
|
+
|
1510
|
+
[1m[36m (14.9ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1511
|
+
[0m
|
1512
|
+
[1m[35m (13.1ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
1513
|
+
[1m[36m (16.9ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1514
|
+
[0m
|
1515
|
+
[1m[35m (16.0ms)[0m select * from information_schema.columns where table_name='superthings';
|
1516
|
+
|
1517
|
+
[1m[36m (0.5ms)[0m [1mBEGIN[0m
|
1518
|
+
[1m[35m (2.4ms)[0m DROP TABLE "containers"
|
1519
|
+
[1m[36m (4.8ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
1520
|
+
[1m[35m (2.0ms)[0m DROP TABLE "subthing_twos"
|
1521
|
+
[1m[36m (2.0ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
1522
|
+
[1m[35m (2.1ms)[0m DROP TABLE "superthings"
|
1523
|
+
[1m[36m (6.6ms)[0m [1mCOMMIT[0m
|
1524
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1525
|
+
[1m[35m (14.1ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1526
|
+
[1m[36m (6.4ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1527
|
+
[1m[35m (10.0ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1528
|
+
[1m[36m (14.9ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1529
|
+
[1m[35m (18.2ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1530
|
+
[1m[36m (3.1ms)[0m [1mCOMMIT[0m
|
1531
|
+
[1m[35m (1.2ms)[0m BEGIN
|
1532
|
+
[1m[36m (3.1ms)[0m [1mDROP TABLE "containers"[0m
|
1533
|
+
[1m[35m (6.9ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1534
|
+
[1m[36m (5.8ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
1535
|
+
[1m[35m (2.7ms)[0m DROP TABLE "subthing_ones"
|
1536
|
+
[1m[36m (2.3ms)[0m [1mDROP TABLE "superthings"[0m
|
1537
|
+
[1m[35m (4.5ms)[0m COMMIT
|
1538
|
+
[1m[36m (0.7ms)[0m [1mBEGIN[0m
|
1539
|
+
[1m[35m (13.5ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1540
|
+
[1m[36m (8.4ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1541
|
+
[1m[35m (11.0ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1542
|
+
[1m[36m (13.0ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1543
|
+
[1m[35m (10.1ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1544
|
+
[1m[36m (3.8ms)[0m [1mCOMMIT[0m
|
1545
|
+
[1m[35m (6.9ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1546
|
+
[1m[36m (31.6ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1547
|
+
[0m
|
1548
|
+
[1m[35m (17.8ms)[0m select * from information_schema.columns where table_name='superthings';
|
1549
|
+
|
1550
|
+
[1m[36m (11.1ms)[0m [1m select * from information_schema.constraint_column_usage where table_name='superthings';
|
1551
|
+
[0m
|
1552
|
+
[1m[35m (15.8ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
1553
|
+
[1m[36m (17.7ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1554
|
+
[0m
|
1555
|
+
[1m[35m (16.2ms)[0m select * from information_schema.columns where table_name='superthings';
|
1556
|
+
|
1557
|
+
[1m[36m (2.7ms)[0m [1mBEGIN[0m
|
1558
|
+
[1m[35m (3.3ms)[0m DROP TABLE "containers"
|
1559
|
+
[1m[36m (6.4ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
1560
|
+
[1m[35m (2.3ms)[0m DROP TABLE "subthing_twos"
|
1561
|
+
[1m[36m (2.1ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
1562
|
+
[1m[35m (2.1ms)[0m DROP TABLE "superthings"
|
1563
|
+
[1m[36m (4.5ms)[0m [1mCOMMIT[0m
|
1564
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1565
|
+
[1m[35m (9.9ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1566
|
+
[1m[36m (8.9ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1567
|
+
[1m[35m (7.3ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1568
|
+
[1m[36m (17.8ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1569
|
+
[1m[35m (9.2ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1570
|
+
[1m[36m (4.2ms)[0m [1mCOMMIT[0m
|
1571
|
+
[1m[35m (0.4ms)[0m BEGIN
|
1572
|
+
[1m[36m (2.6ms)[0m [1mDROP TABLE "containers"[0m
|
1573
|
+
[1m[35m (4.9ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1574
|
+
[1m[36m (2.1ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
1575
|
+
[1m[35m (2.3ms)[0m DROP TABLE "subthing_ones"
|
1576
|
+
[1m[36m (2.1ms)[0m [1mDROP TABLE "superthings"[0m
|
1577
|
+
[1m[35m (4.7ms)[0m COMMIT
|
1578
|
+
[1m[36m (0.7ms)[0m [1mBEGIN[0m
|
1579
|
+
[1m[35m (10.4ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1580
|
+
[1m[36m (9.7ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1581
|
+
[1m[35m (7.1ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1582
|
+
[1m[36m (14.7ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1583
|
+
[1m[35m (8.3ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1584
|
+
[1m[36m (4.0ms)[0m [1mCOMMIT[0m
|
1585
|
+
[1m[35m (9.4ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1586
|
+
[1m[36m (26.7ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1587
|
+
[0m
|
1588
|
+
[1m[35m (14.7ms)[0m select * from information_schema.constraint_column_usage where table_name='superthings';
|
1589
|
+
|
1590
|
+
[1m[36m (17.8ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1591
|
+
[0m
|
1592
|
+
[1m[35m (14.0ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
1593
|
+
[1m[36m (14.9ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1594
|
+
[0m
|
1595
|
+
[1m[35m (14.6ms)[0m select * from information_schema.columns where table_name='superthings';
|
1596
|
+
|
1597
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1598
|
+
[1m[35m (2.1ms)[0m DROP TABLE "containers"
|
1599
|
+
[1m[36m (5.1ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
1600
|
+
[1m[35m (2.1ms)[0m DROP TABLE "subthing_twos"
|
1601
|
+
[1m[36m (3.3ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
1602
|
+
[1m[35m (2.3ms)[0m DROP TABLE "superthings"
|
1603
|
+
[1m[36m (3.9ms)[0m [1mCOMMIT[0m
|
1604
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1605
|
+
[1m[35m (26.6ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1606
|
+
[1m[36m (6.4ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1607
|
+
[1m[35m (9.8ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1608
|
+
[1m[36m (21.8ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1609
|
+
[1m[35m (17.8ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1610
|
+
[1m[36m (3.6ms)[0m [1mCOMMIT[0m
|
1611
|
+
[1m[35m (37.1ms)[0m select * from information_schema.columns where table_name='superthings';
|
1612
|
+
|
1613
|
+
[1m[36m (15.0ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1614
|
+
[0m
|
1615
|
+
[1m[35m (7.3ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1616
|
+
[1m[36m (16.1ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1617
|
+
[0m
|
1618
|
+
[1m[35m (14.5ms)[0m select * from information_schema.columns where table_name='superthings';
|
1619
|
+
|
1620
|
+
[1m[36m (9.0ms)[0m [1m select * from information_schema.constraint_column_usage where table_name='superthings';
|
1621
|
+
[0m
|
1622
|
+
[1m[35m (17.5ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
1623
|
+
[1m[36m (0.4ms)[0m [1mBEGIN[0m
|
1624
|
+
[1m[35m (2.5ms)[0m DROP TABLE "containers"
|
1625
|
+
[1m[36m (5.2ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
1626
|
+
[1m[35m (2.1ms)[0m DROP TABLE "subthing_twos"
|
1627
|
+
[1m[36m (2.1ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
1628
|
+
[1m[35m (2.0ms)[0m DROP TABLE "superthings"
|
1629
|
+
[1m[36m (4.1ms)[0m [1mCOMMIT[0m
|
1630
|
+
[1m[35m (0.8ms)[0m BEGIN
|
1631
|
+
[1m[36m (7.1ms)[0m [1mCREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1632
|
+
[1m[35m (10.8ms)[0m CREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1633
|
+
[1m[36m (32.3ms)[0m [1mCREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1634
|
+
[1m[35m (14.7ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
1635
|
+
[1m[36m (10.9ms)[0m [1mCREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1636
|
+
[1m[35m (26.5ms)[0m COMMIT
|
1637
|
+
[1m[36m (12.8ms)[0m [1mBEGIN[0m
|
1638
|
+
[1m[35m (2.3ms)[0m DROP TABLE "containers"
|
1639
|
+
[1m[36m (5.4ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
1640
|
+
[1m[35m (2.7ms)[0m DROP TABLE "subthing_twos"
|
1641
|
+
[1m[36m (2.3ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
1642
|
+
[1m[35m (2.4ms)[0m DROP TABLE "superthings"
|
1643
|
+
[1m[36m (4.0ms)[0m [1mCOMMIT[0m
|
1644
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1645
|
+
[1m[35m (25.0ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1646
|
+
[1m[36m (20.1ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1647
|
+
[1m[35m (12.8ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1648
|
+
[1m[36m (38.8ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1649
|
+
[1m[35m (12.4ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1650
|
+
[1m[36m (9.4ms)[0m [1mCOMMIT[0m
|
1651
|
+
[1m[35m (0.3ms)[0m BEGIN
|
1652
|
+
[1m[36m (4.2ms)[0m [1mDROP TABLE "containers"[0m
|
1653
|
+
[1m[35m (10.5ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1654
|
+
[1m[36m (3.1ms)[0m [1mDROP TABLE "subthing_twos"[0m
|
1655
|
+
[1m[35m (2.5ms)[0m DROP TABLE "subthing_ones"
|
1656
|
+
[1m[36m (3.6ms)[0m [1mDROP TABLE "superthings"[0m
|
1657
|
+
[1m[35m (17.9ms)[0m COMMIT
|
1658
|
+
[1m[36m (0.8ms)[0m [1mBEGIN[0m
|
1659
|
+
[1m[35m (10.8ms)[0m CREATE TABLE "superthings" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1660
|
+
[1m[36m (10.3ms)[0m [1mCREATE TABLE "subthing_ones" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp) [0m
|
1661
|
+
[1m[35m (15.9ms)[0m CREATE TABLE "subthing_twos" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1662
|
+
[1m[36m (13.8ms)[0m [1mALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;[0m
|
1663
|
+
[1m[35m (9.3ms)[0m CREATE TABLE "containers" ("id" serial primary key, "content" text, "created_at" timestamp, "updated_at" timestamp)
|
1664
|
+
[1m[36m (3.3ms)[0m [1mCOMMIT[0m
|
1665
|
+
[1m[35m (12.6ms)[0m ALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;
|
1666
|
+
[1m[36m (31.8ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1667
|
+
[0m
|
1668
|
+
[1m[35m (19.7ms)[0m select * from information_schema.constraint_column_usage where table_name='superthings';
|
1669
|
+
|
1670
|
+
[1m[36m (26.9ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1671
|
+
[0m
|
1672
|
+
[1m[35m (36.3ms)[0m ALTER TABLE superthings ADD COLUMN subthing_ones_id BIGINT NOT NULL UNIQUE REFERENCES subthing_ones(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD COLUMN subthing_twos_id BIGINT NOT NULL UNIQUE REFERENCES subthing_twos(id) DEFERRABLE INITIALLY DEFERRED;ALTER TABLE superthings ADD CONSTRAINT superthings_xor CHECK ( (subthing_ones_id IS NOT NULL)::INTEGER + (subthing_twos_id IS NOT NULL)::INTEGER = 1 );ALTER TABLE subthing_ones ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_ones_id) DEFERRABLE INITIALLY DEFERRED ;ALTER TABLE subthing_twos ADD CONSTRAINT id_fkey FOREIGN KEY(id) REFERENCES superthings(subthing_twos_id) DEFERRABLE INITIALLY DEFERRED ;
|
1673
|
+
[1m[36m (42.5ms)[0m [1m select * from information_schema.columns where table_name='superthings';
|
1674
|
+
[0m
|
1675
|
+
[1m[35m (55.6ms)[0m select * from information_schema.columns where table_name='superthings';
|
1676
|
+
|
1677
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1678
|
+
[1m[35m (2.4ms)[0m DROP TABLE "containers"
|
1679
|
+
[1m[36m (11.4ms)[0m [1mALTER TABLE subthing_ones DROP CONSTRAINT id_fkey;ALTER TABLE subthing_twos DROP CONSTRAINT id_fkey;ALTER TABLE superthings DROP CONSTRAINT superthings_xor;ALTER TABLE superthings DROP COLUMN subthing_ones_id;ALTER TABLE superthings DROP COLUMN subthing_twos_id;[0m
|
1680
|
+
[1m[35m (15.2ms)[0m DROP TABLE "subthing_twos"
|
1681
|
+
[1m[36m (5.8ms)[0m [1mDROP TABLE "subthing_ones"[0m
|
1682
|
+
[1m[35m (5.3ms)[0m DROP TABLE "superthings"
|
1683
|
+
[1m[36m (16.9ms)[0m [1mCOMMIT[0m
|