2015-06-23 94 views
0

已經有一段時間了,但我現在只關心這一點。Rails:遷移後的奇怪查詢

在Rails 3.2中,每次運行遷移(rake db:migrate)時,在執行遷移的正常SQL日誌之後,我收到了一堆非常混亂的查詢。

在這裏,他們是:

(0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ('20150623124632') 
    (5.6ms) COMMIT 
    (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
    (5.9ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'addresses' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (4.2ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'authentications' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.3ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'balancing_transactions' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.6ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'billing_informations' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.4ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'bills' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.1ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'checkins' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.2ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'converters' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.2ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'copass_transactions' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.2ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'copasser_preferences' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.2ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'copassers' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.2ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'cospace_comments' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.0ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'cospace_copasser_interactions' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.1ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'cospace_event_type_associations' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.2ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'cospace_pictures' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.1ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'cospace_recommends' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.1ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'cospace_tag_votes' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.3ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'cospace_transaction_templates' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.2ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'cospace_type_associations' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.1ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'cospace_wishlists' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.1ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'cospaces' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.2ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'countries' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.2ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'coupons' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.4ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'currency_accounts' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (6.9ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'delayed_jobs' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.4ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'event_types' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.2ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'external_transactions' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.3ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'faqs' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.5ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'finances' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.4ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'friend_suggestions' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.2ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'friendship_notifications' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (9.0ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'friendships' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.4ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'group_copassers' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (6.9ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'groups' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c.conname 

    (5.2ms) 
SELECT t2.relname AS to_table 
, a1.attname AS column 
, a2.attname AS primary_key 
, c.conname AS name 
, c.confdeltype AS dependency 
, c.confupdtype AS update_dependency 
, c.condeferrable AS deferrable 
, c.condeferred AS deferred 
, c.convalidated AS valid 
FROM pg_constraint c 
JOIN pg_class t1 ON c.conrelid = t1.oid 
JOIN pg_class t2 ON c.confrelid = t2.oid 
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid 
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid 
JOIN pg_namespace t3 ON c.connamespace = t3.oid 
WHERE c.contype = 'f' 
AND t1.relname = 'in_progress_transactions' 
AND t3.nspname = ANY (current_schemas(false)) 
ORDER BY c. 

# [TRUNKED BECAUSE OF Stackoverflow LIMITATION] 

它從來沒有破壞任何東西,因爲那些只是SELECT S,但他們都非常難看,並阻止我輕鬆地檢查一切正常。

任何想法這是從哪裏來的?

回答

0

這看起來像Rails爬取模式以找出模型的結構。 db:migrate通常是安靜的,所以如果你使用那個(通常用Heroku),輸出可能是由於rails_12factor寶石。如果是這樣,您可以使用this question's解決方案,並將該寶石包裝在:production塊中,因爲它不需要在開發中運行。

group :production do 
    gem 'rails_12factor' 
end