mas-rad_core 0.0.65 → 0.0.66

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 33cb36bb01f3c14413d7aee0ad1055c80ceb4a60
4
- data.tar.gz: 4e760c5c471df52e137c3310406c45eb2797a004
3
+ metadata.gz: d212f7c0b14efee69e0a81821647dd7a9515e30e
4
+ data.tar.gz: de83149c7e67c9a004078c6d391b64436681f8a3
5
5
  SHA512:
6
- metadata.gz: fcf8d49f70303b59163135ecdf270ef68663e545f76598f275730ba4c7771220c31c03c6b7f8949cc10798387e919df00f9c0ec6b3f963e5f5103929b724278e
7
- data.tar.gz: 5bd048ae1b37e5e35270746d19e76906aaba96aead4fff89694dc7684297a8e7ddd31bd58fa6077809e21484a82a4585d7dd69495c6736f973288dd6ab18e3fc
6
+ metadata.gz: 83fe9bd25e6ef96a052fe5c9d6830298b917aae6c34c5888fcc3d2ee136985afa951b2d254bc708c356d5b39b7a7e1c0ccea0e2f6a56edda8f034db9b1a39186
7
+ data.tar.gz: 8187dd6482dc6ec988e858c134928b262e84f0ff6658400a42363504ff595781c9eb55f682e4d9e0a920192e2f4def178807e7bef753572654ebcdc36de56012
@@ -113,6 +113,10 @@ class Firm < ActiveRecord::Base
113
113
  after_commit :geocode, if: :valid?
114
114
  after_commit :delete_elastic_search_entry, if: :destroyed?
115
115
 
116
+ def registered?
117
+ email_address.present?
118
+ end
119
+
116
120
  def telephone_number
117
121
  return nil unless self[:telephone_number]
118
122
 
@@ -71,8 +71,31 @@ class Principal < ActiveRecord::Base
71
71
  "#{first_name} #{last_name}"
72
72
  end
73
73
 
74
+ def next_onboarding_action
75
+ registered_firms = main_firm_with_trading_names.registered
76
+
77
+ case
78
+ when registered_firms.empty?
79
+ :complete_a_firm
80
+ when any_remote_firms?(registered_firms)
81
+ :onboarded
82
+ when needs_advisers?(registered_firms)
83
+ :complete_an_adviser
84
+ else
85
+ :onboarded
86
+ end
87
+ end
88
+
74
89
  private
75
90
 
91
+ def any_remote_firms?(firm_list)
92
+ firm_list.any? { |f| f.primary_advice_method == :remote }
93
+ end
94
+
95
+ def needs_advisers?(firm_list)
96
+ firm_list.none? { |f| f.advisers.present? }
97
+ end
98
+
76
99
  def find_subsidiary(subsidiary)
77
100
  firm.subsidiaries.find_or_initialize_by(
78
101
  registered_name: subsidiary.name,
@@ -1,5 +1,5 @@
1
1
  module MAS
2
2
  module RadCore
3
- VERSION = '0.0.65'
3
+ VERSION = '0.0.66'
4
4
  end
5
5
  end
@@ -353470,3 +353470,1600 @@ WHERE c.contype = 'f'
353470
353470
  AND t3.nspname = ANY (current_schemas(false))
353471
353471
  ORDER BY c.conname
353472
353472
  
353473
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
353474
+ Migrating to AddLanguagesToFirm (20150807134551)
353475
+  (0.3ms) BEGIN
353476
+  (35.3ms) ALTER TABLE "firms" ADD "languages" text[] DEFAULT '{}' NOT NULL
353477
+ SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150807134551"]]
353478
+  (2.3ms) COMMIT
353479
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
353480
+  (4.6ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353481
+ FROM pg_constraint c
353482
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353483
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353484
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353485
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353486
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353487
+ WHERE c.contype = 'f'
353488
+ AND t1.relname = 'accreditations'
353489
+ AND t3.nspname = ANY (current_schemas(false))
353490
+ ORDER BY c.conname
353491
+ 
353492
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353493
+ FROM pg_constraint c
353494
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353495
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353496
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353497
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353498
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353499
+ WHERE c.contype = 'f'
353500
+ AND t1.relname = 'accreditations_advisers'
353501
+ AND t3.nspname = ANY (current_schemas(false))
353502
+ ORDER BY c.conname
353503
+
353504
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353505
+ FROM pg_constraint c
353506
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353507
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353508
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353509
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353510
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353511
+ WHERE c.contype = 'f'
353512
+ AND t1.relname = 'advisers'
353513
+ AND t3.nspname = ANY (current_schemas(false))
353514
+ ORDER BY c.conname
353515
+ 
353516
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353517
+ FROM pg_constraint c
353518
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353519
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353520
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353521
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353522
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353523
+ WHERE c.contype = 'f'
353524
+ AND t1.relname = 'advisers_professional_bodies'
353525
+ AND t3.nspname = ANY (current_schemas(false))
353526
+ ORDER BY c.conname
353527
+
353528
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353529
+ FROM pg_constraint c
353530
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353531
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353532
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353533
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353534
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353535
+ WHERE c.contype = 'f'
353536
+ AND t1.relname = 'advisers_professional_standings'
353537
+ AND t3.nspname = ANY (current_schemas(false))
353538
+ ORDER BY c.conname
353539
+ 
353540
+  (3.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353541
+ FROM pg_constraint c
353542
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353543
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353544
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353545
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353546
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353547
+ WHERE c.contype = 'f'
353548
+ AND t1.relname = 'advisers_qualifications'
353549
+ AND t3.nspname = ANY (current_schemas(false))
353550
+ ORDER BY c.conname
353551
+
353552
+  (3.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353553
+ FROM pg_constraint c
353554
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353555
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353556
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353557
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353558
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353559
+ WHERE c.contype = 'f'
353560
+ AND t1.relname = 'allowed_payment_methods'
353561
+ AND t3.nspname = ANY (current_schemas(false))
353562
+ ORDER BY c.conname
353563
+ 
353564
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353565
+ FROM pg_constraint c
353566
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353567
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353568
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353569
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353570
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353571
+ WHERE c.contype = 'f'
353572
+ AND t1.relname = 'allowed_payment_methods_firms'
353573
+ AND t3.nspname = ANY (current_schemas(false))
353574
+ ORDER BY c.conname
353575
+
353576
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353577
+ FROM pg_constraint c
353578
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353579
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353580
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353581
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353582
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353583
+ WHERE c.contype = 'f'
353584
+ AND t1.relname = 'firms'
353585
+ AND t3.nspname = ANY (current_schemas(false))
353586
+ ORDER BY c.conname
353587
+ 
353588
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353589
+ FROM pg_constraint c
353590
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353591
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353592
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353593
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353594
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353595
+ WHERE c.contype = 'f'
353596
+ AND t1.relname = 'firms_in_person_advice_methods'
353597
+ AND t3.nspname = ANY (current_schemas(false))
353598
+ ORDER BY c.conname
353599
+
353600
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353601
+ FROM pg_constraint c
353602
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353603
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353604
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353605
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353606
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353607
+ WHERE c.contype = 'f'
353608
+ AND t1.relname = 'firms_initial_advice_fee_structures'
353609
+ AND t3.nspname = ANY (current_schemas(false))
353610
+ ORDER BY c.conname
353611
+ 
353612
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353613
+ FROM pg_constraint c
353614
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353615
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353616
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353617
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353618
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353619
+ WHERE c.contype = 'f'
353620
+ AND t1.relname = 'firms_investment_sizes'
353621
+ AND t3.nspname = ANY (current_schemas(false))
353622
+ ORDER BY c.conname
353623
+
353624
+  (4.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353625
+ FROM pg_constraint c
353626
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353627
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353628
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353629
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353630
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353631
+ WHERE c.contype = 'f'
353632
+ AND t1.relname = 'firms_ongoing_advice_fee_structures'
353633
+ AND t3.nspname = ANY (current_schemas(false))
353634
+ ORDER BY c.conname
353635
+ 
353636
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353637
+ FROM pg_constraint c
353638
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353639
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353640
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353641
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353642
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353643
+ WHERE c.contype = 'f'
353644
+ AND t1.relname = 'firms_other_advice_methods'
353645
+ AND t3.nspname = ANY (current_schemas(false))
353646
+ ORDER BY c.conname
353647
+
353648
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353649
+ FROM pg_constraint c
353650
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353651
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353652
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353653
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353654
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353655
+ WHERE c.contype = 'f'
353656
+ AND t1.relname = 'in_person_advice_methods'
353657
+ AND t3.nspname = ANY (current_schemas(false))
353658
+ ORDER BY c.conname
353659
+ 
353660
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353661
+ FROM pg_constraint c
353662
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353663
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353664
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353665
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353666
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353667
+ WHERE c.contype = 'f'
353668
+ AND t1.relname = 'initial_advice_fee_structures'
353669
+ AND t3.nspname = ANY (current_schemas(false))
353670
+ ORDER BY c.conname
353671
+
353672
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353673
+ FROM pg_constraint c
353674
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353675
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353676
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353677
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353678
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353679
+ WHERE c.contype = 'f'
353680
+ AND t1.relname = 'initial_meeting_durations'
353681
+ AND t3.nspname = ANY (current_schemas(false))
353682
+ ORDER BY c.conname
353683
+ 
353684
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353685
+ FROM pg_constraint c
353686
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353687
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353688
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353689
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353690
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353691
+ WHERE c.contype = 'f'
353692
+ AND t1.relname = 'investment_sizes'
353693
+ AND t3.nspname = ANY (current_schemas(false))
353694
+ ORDER BY c.conname
353695
+
353696
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353697
+ FROM pg_constraint c
353698
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353699
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353700
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353701
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353702
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353703
+ WHERE c.contype = 'f'
353704
+ AND t1.relname = 'lookup_advisers'
353705
+ AND t3.nspname = ANY (current_schemas(false))
353706
+ ORDER BY c.conname
353707
+ 
353708
+  (3.4ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353709
+ FROM pg_constraint c
353710
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353711
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353712
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353713
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353714
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353715
+ WHERE c.contype = 'f'
353716
+ AND t1.relname = 'lookup_firms'
353717
+ AND t3.nspname = ANY (current_schemas(false))
353718
+ ORDER BY c.conname
353719
+
353720
+  (3.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353721
+ FROM pg_constraint c
353722
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353723
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353724
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353725
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353726
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353727
+ WHERE c.contype = 'f'
353728
+ AND t1.relname = 'lookup_subsidiaries'
353729
+ AND t3.nspname = ANY (current_schemas(false))
353730
+ ORDER BY c.conname
353731
+ 
353732
+  (3.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353733
+ FROM pg_constraint c
353734
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353735
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353736
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353737
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353738
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353739
+ WHERE c.contype = 'f'
353740
+ AND t1.relname = 'old_passwords'
353741
+ AND t3.nspname = ANY (current_schemas(false))
353742
+ ORDER BY c.conname
353743
+
353744
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353745
+ FROM pg_constraint c
353746
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353747
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353748
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353749
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353750
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353751
+ WHERE c.contype = 'f'
353752
+ AND t1.relname = 'ongoing_advice_fee_structures'
353753
+ AND t3.nspname = ANY (current_schemas(false))
353754
+ ORDER BY c.conname
353755
+ 
353756
+  (3.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353757
+ FROM pg_constraint c
353758
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353759
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353760
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353761
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353762
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353763
+ WHERE c.contype = 'f'
353764
+ AND t1.relname = 'other_advice_methods'
353765
+ AND t3.nspname = ANY (current_schemas(false))
353766
+ ORDER BY c.conname
353767
+
353768
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353769
+ FROM pg_constraint c
353770
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353771
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353772
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353773
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353774
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353775
+ WHERE c.contype = 'f'
353776
+ AND t1.relname = 'principals'
353777
+ AND t3.nspname = ANY (current_schemas(false))
353778
+ ORDER BY c.conname
353779
+ 
353780
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353781
+ FROM pg_constraint c
353782
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353783
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353784
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353785
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353786
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353787
+ WHERE c.contype = 'f'
353788
+ AND t1.relname = 'professional_bodies'
353789
+ AND t3.nspname = ANY (current_schemas(false))
353790
+ ORDER BY c.conname
353791
+
353792
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353793
+ FROM pg_constraint c
353794
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353795
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353796
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353797
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353798
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353799
+ WHERE c.contype = 'f'
353800
+ AND t1.relname = 'professional_standings'
353801
+ AND t3.nspname = ANY (current_schemas(false))
353802
+ ORDER BY c.conname
353803
+ 
353804
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353805
+ FROM pg_constraint c
353806
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353807
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353808
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353809
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353810
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353811
+ WHERE c.contype = 'f'
353812
+ AND t1.relname = 'qualifications'
353813
+ AND t3.nspname = ANY (current_schemas(false))
353814
+ ORDER BY c.conname
353815
+
353816
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353817
+ FROM pg_constraint c
353818
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353819
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353820
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353821
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353822
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353823
+ WHERE c.contype = 'f'
353824
+ AND t1.relname = 'users'
353825
+ AND t3.nspname = ANY (current_schemas(false))
353826
+ ORDER BY c.conname
353827
+ 
353828
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
353829
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
353830
+ Migrating to AddLanguagesToFirm (20150807134551)
353831
+  (0.2ms) BEGIN
353832
+  (1.4ms) ALTER TABLE "firms" DROP "languages"
353833
+ SQL (0.5ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20150807134551"]]
353834
+  (0.5ms) COMMIT
353835
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
353836
+  (3.8ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353837
+ FROM pg_constraint c
353838
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353839
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353840
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353841
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353842
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353843
+ WHERE c.contype = 'f'
353844
+ AND t1.relname = 'accreditations'
353845
+ AND t3.nspname = ANY (current_schemas(false))
353846
+ ORDER BY c.conname
353847
+
353848
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353849
+ FROM pg_constraint c
353850
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353851
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353852
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353853
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353854
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353855
+ WHERE c.contype = 'f'
353856
+ AND t1.relname = 'accreditations_advisers'
353857
+ AND t3.nspname = ANY (current_schemas(false))
353858
+ ORDER BY c.conname
353859
+ 
353860
+  (2.9ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353861
+ FROM pg_constraint c
353862
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353863
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353864
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353865
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353866
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353867
+ WHERE c.contype = 'f'
353868
+ AND t1.relname = 'advisers'
353869
+ AND t3.nspname = ANY (current_schemas(false))
353870
+ ORDER BY c.conname
353871
+
353872
+  (3.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353873
+ FROM pg_constraint c
353874
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353875
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353876
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353877
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353878
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353879
+ WHERE c.contype = 'f'
353880
+ AND t1.relname = 'advisers_professional_bodies'
353881
+ AND t3.nspname = ANY (current_schemas(false))
353882
+ ORDER BY c.conname
353883
+ 
353884
+  (3.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353885
+ FROM pg_constraint c
353886
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353887
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353888
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353889
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353890
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353891
+ WHERE c.contype = 'f'
353892
+ AND t1.relname = 'advisers_professional_standings'
353893
+ AND t3.nspname = ANY (current_schemas(false))
353894
+ ORDER BY c.conname
353895
+
353896
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353897
+ FROM pg_constraint c
353898
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353899
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353900
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353901
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353902
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353903
+ WHERE c.contype = 'f'
353904
+ AND t1.relname = 'advisers_qualifications'
353905
+ AND t3.nspname = ANY (current_schemas(false))
353906
+ ORDER BY c.conname
353907
+ 
353908
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353909
+ FROM pg_constraint c
353910
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353911
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353912
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353913
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353914
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353915
+ WHERE c.contype = 'f'
353916
+ AND t1.relname = 'allowed_payment_methods'
353917
+ AND t3.nspname = ANY (current_schemas(false))
353918
+ ORDER BY c.conname
353919
+
353920
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353921
+ FROM pg_constraint c
353922
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353923
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353924
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353925
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353926
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353927
+ WHERE c.contype = 'f'
353928
+ AND t1.relname = 'allowed_payment_methods_firms'
353929
+ AND t3.nspname = ANY (current_schemas(false))
353930
+ ORDER BY c.conname
353931
+ 
353932
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353933
+ FROM pg_constraint c
353934
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353935
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353936
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353937
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353938
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353939
+ WHERE c.contype = 'f'
353940
+ AND t1.relname = 'firms'
353941
+ AND t3.nspname = ANY (current_schemas(false))
353942
+ ORDER BY c.conname
353943
+
353944
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353945
+ FROM pg_constraint c
353946
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353947
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353948
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353949
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353950
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353951
+ WHERE c.contype = 'f'
353952
+ AND t1.relname = 'firms_in_person_advice_methods'
353953
+ AND t3.nspname = ANY (current_schemas(false))
353954
+ ORDER BY c.conname
353955
+ 
353956
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353957
+ FROM pg_constraint c
353958
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353959
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353960
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353961
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353962
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353963
+ WHERE c.contype = 'f'
353964
+ AND t1.relname = 'firms_initial_advice_fee_structures'
353965
+ AND t3.nspname = ANY (current_schemas(false))
353966
+ ORDER BY c.conname
353967
+
353968
+  (3.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353969
+ FROM pg_constraint c
353970
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353971
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353972
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353973
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353974
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353975
+ WHERE c.contype = 'f'
353976
+ AND t1.relname = 'firms_investment_sizes'
353977
+ AND t3.nspname = ANY (current_schemas(false))
353978
+ ORDER BY c.conname
353979
+ 
353980
+  (3.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353981
+ FROM pg_constraint c
353982
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353983
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353984
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353985
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353986
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353987
+ WHERE c.contype = 'f'
353988
+ AND t1.relname = 'firms_ongoing_advice_fee_structures'
353989
+ AND t3.nspname = ANY (current_schemas(false))
353990
+ ORDER BY c.conname
353991
+
353992
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
353993
+ FROM pg_constraint c
353994
+ JOIN pg_class t1 ON c.conrelid = t1.oid
353995
+ JOIN pg_class t2 ON c.confrelid = t2.oid
353996
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
353997
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
353998
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
353999
+ WHERE c.contype = 'f'
354000
+ AND t1.relname = 'firms_other_advice_methods'
354001
+ AND t3.nspname = ANY (current_schemas(false))
354002
+ ORDER BY c.conname
354003
+ 
354004
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354005
+ FROM pg_constraint c
354006
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354007
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354008
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354009
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354010
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354011
+ WHERE c.contype = 'f'
354012
+ AND t1.relname = 'in_person_advice_methods'
354013
+ AND t3.nspname = ANY (current_schemas(false))
354014
+ ORDER BY c.conname
354015
+
354016
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354017
+ FROM pg_constraint c
354018
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354019
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354020
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354021
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354022
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354023
+ WHERE c.contype = 'f'
354024
+ AND t1.relname = 'initial_advice_fee_structures'
354025
+ AND t3.nspname = ANY (current_schemas(false))
354026
+ ORDER BY c.conname
354027
+ 
354028
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354029
+ FROM pg_constraint c
354030
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354031
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354032
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354033
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354034
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354035
+ WHERE c.contype = 'f'
354036
+ AND t1.relname = 'initial_meeting_durations'
354037
+ AND t3.nspname = ANY (current_schemas(false))
354038
+ ORDER BY c.conname
354039
+
354040
+  (3.4ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354041
+ FROM pg_constraint c
354042
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354043
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354044
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354045
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354046
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354047
+ WHERE c.contype = 'f'
354048
+ AND t1.relname = 'investment_sizes'
354049
+ AND t3.nspname = ANY (current_schemas(false))
354050
+ ORDER BY c.conname
354051
+ 
354052
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354053
+ FROM pg_constraint c
354054
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354055
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354056
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354057
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354058
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354059
+ WHERE c.contype = 'f'
354060
+ AND t1.relname = 'lookup_advisers'
354061
+ AND t3.nspname = ANY (current_schemas(false))
354062
+ ORDER BY c.conname
354063
+
354064
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354065
+ FROM pg_constraint c
354066
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354067
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354068
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354069
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354070
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354071
+ WHERE c.contype = 'f'
354072
+ AND t1.relname = 'lookup_firms'
354073
+ AND t3.nspname = ANY (current_schemas(false))
354074
+ ORDER BY c.conname
354075
+ 
354076
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354077
+ FROM pg_constraint c
354078
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354079
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354080
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354081
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354082
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354083
+ WHERE c.contype = 'f'
354084
+ AND t1.relname = 'lookup_subsidiaries'
354085
+ AND t3.nspname = ANY (current_schemas(false))
354086
+ ORDER BY c.conname
354087
+
354088
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354089
+ FROM pg_constraint c
354090
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354091
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354092
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354093
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354094
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354095
+ WHERE c.contype = 'f'
354096
+ AND t1.relname = 'old_passwords'
354097
+ AND t3.nspname = ANY (current_schemas(false))
354098
+ ORDER BY c.conname
354099
+ 
354100
+  (3.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354101
+ FROM pg_constraint c
354102
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354103
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354104
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354105
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354106
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354107
+ WHERE c.contype = 'f'
354108
+ AND t1.relname = 'ongoing_advice_fee_structures'
354109
+ AND t3.nspname = ANY (current_schemas(false))
354110
+ ORDER BY c.conname
354111
+
354112
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354113
+ FROM pg_constraint c
354114
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354115
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354116
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354117
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354118
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354119
+ WHERE c.contype = 'f'
354120
+ AND t1.relname = 'other_advice_methods'
354121
+ AND t3.nspname = ANY (current_schemas(false))
354122
+ ORDER BY c.conname
354123
+ 
354124
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354125
+ FROM pg_constraint c
354126
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354127
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354128
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354129
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354130
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354131
+ WHERE c.contype = 'f'
354132
+ AND t1.relname = 'principals'
354133
+ AND t3.nspname = ANY (current_schemas(false))
354134
+ ORDER BY c.conname
354135
+
354136
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354137
+ FROM pg_constraint c
354138
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354139
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354140
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354141
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354142
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354143
+ WHERE c.contype = 'f'
354144
+ AND t1.relname = 'professional_bodies'
354145
+ AND t3.nspname = ANY (current_schemas(false))
354146
+ ORDER BY c.conname
354147
+ 
354148
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354149
+ FROM pg_constraint c
354150
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354151
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354152
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354153
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354154
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354155
+ WHERE c.contype = 'f'
354156
+ AND t1.relname = 'professional_standings'
354157
+ AND t3.nspname = ANY (current_schemas(false))
354158
+ ORDER BY c.conname
354159
+
354160
+  (3.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354161
+ FROM pg_constraint c
354162
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354163
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354164
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354165
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354166
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354167
+ WHERE c.contype = 'f'
354168
+ AND t1.relname = 'qualifications'
354169
+ AND t3.nspname = ANY (current_schemas(false))
354170
+ ORDER BY c.conname
354171
+ 
354172
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354173
+ FROM pg_constraint c
354174
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354175
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354176
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354177
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354178
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354179
+ WHERE c.contype = 'f'
354180
+ AND t1.relname = 'users'
354181
+ AND t3.nspname = ANY (current_schemas(false))
354182
+ ORDER BY c.conname
354183
+
354184
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
354185
+ Migrating to AddLanguagesToFirm (20150807134551)
354186
+  (0.2ms) BEGIN
354187
+  (31.3ms) ALTER TABLE "firms" ADD "languages" text[] DEFAULT '{en}' NOT NULL
354188
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150807134551"]]
354189
+  (1.6ms) COMMIT
354190
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
354191
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354192
+ FROM pg_constraint c
354193
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354194
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354195
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354196
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354197
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354198
+ WHERE c.contype = 'f'
354199
+ AND t1.relname = 'accreditations'
354200
+ AND t3.nspname = ANY (current_schemas(false))
354201
+ ORDER BY c.conname
354202
+ 
354203
+  (3.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354204
+ FROM pg_constraint c
354205
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354206
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354207
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354208
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354209
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354210
+ WHERE c.contype = 'f'
354211
+ AND t1.relname = 'accreditations_advisers'
354212
+ AND t3.nspname = ANY (current_schemas(false))
354213
+ ORDER BY c.conname
354214
+
354215
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354216
+ FROM pg_constraint c
354217
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354218
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354219
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354220
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354221
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354222
+ WHERE c.contype = 'f'
354223
+ AND t1.relname = 'advisers'
354224
+ AND t3.nspname = ANY (current_schemas(false))
354225
+ ORDER BY c.conname
354226
+ 
354227
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354228
+ FROM pg_constraint c
354229
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354230
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354231
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354232
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354233
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354234
+ WHERE c.contype = 'f'
354235
+ AND t1.relname = 'advisers_professional_bodies'
354236
+ AND t3.nspname = ANY (current_schemas(false))
354237
+ ORDER BY c.conname
354238
+
354239
+  (3.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354240
+ FROM pg_constraint c
354241
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354242
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354243
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354244
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354245
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354246
+ WHERE c.contype = 'f'
354247
+ AND t1.relname = 'advisers_professional_standings'
354248
+ AND t3.nspname = ANY (current_schemas(false))
354249
+ ORDER BY c.conname
354250
+ 
354251
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354252
+ FROM pg_constraint c
354253
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354254
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354255
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354256
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354257
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354258
+ WHERE c.contype = 'f'
354259
+ AND t1.relname = 'advisers_qualifications'
354260
+ AND t3.nspname = ANY (current_schemas(false))
354261
+ ORDER BY c.conname
354262
+
354263
+  (3.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354264
+ FROM pg_constraint c
354265
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354266
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354267
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354268
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354269
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354270
+ WHERE c.contype = 'f'
354271
+ AND t1.relname = 'allowed_payment_methods'
354272
+ AND t3.nspname = ANY (current_schemas(false))
354273
+ ORDER BY c.conname
354274
+ 
354275
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354276
+ FROM pg_constraint c
354277
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354278
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354279
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354280
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354281
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354282
+ WHERE c.contype = 'f'
354283
+ AND t1.relname = 'allowed_payment_methods_firms'
354284
+ AND t3.nspname = ANY (current_schemas(false))
354285
+ ORDER BY c.conname
354286
+
354287
+  (3.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354288
+ FROM pg_constraint c
354289
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354290
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354291
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354292
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354293
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354294
+ WHERE c.contype = 'f'
354295
+ AND t1.relname = 'firms'
354296
+ AND t3.nspname = ANY (current_schemas(false))
354297
+ ORDER BY c.conname
354298
+ 
354299
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354300
+ FROM pg_constraint c
354301
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354302
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354303
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354304
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354305
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354306
+ WHERE c.contype = 'f'
354307
+ AND t1.relname = 'firms_in_person_advice_methods'
354308
+ AND t3.nspname = ANY (current_schemas(false))
354309
+ ORDER BY c.conname
354310
+
354311
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354312
+ FROM pg_constraint c
354313
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354314
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354315
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354316
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354317
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354318
+ WHERE c.contype = 'f'
354319
+ AND t1.relname = 'firms_initial_advice_fee_structures'
354320
+ AND t3.nspname = ANY (current_schemas(false))
354321
+ ORDER BY c.conname
354322
+ 
354323
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354324
+ FROM pg_constraint c
354325
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354326
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354327
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354328
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354329
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354330
+ WHERE c.contype = 'f'
354331
+ AND t1.relname = 'firms_investment_sizes'
354332
+ AND t3.nspname = ANY (current_schemas(false))
354333
+ ORDER BY c.conname
354334
+
354335
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354336
+ FROM pg_constraint c
354337
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354338
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354339
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354340
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354341
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354342
+ WHERE c.contype = 'f'
354343
+ AND t1.relname = 'firms_ongoing_advice_fee_structures'
354344
+ AND t3.nspname = ANY (current_schemas(false))
354345
+ ORDER BY c.conname
354346
+ 
354347
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354348
+ FROM pg_constraint c
354349
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354350
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354351
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354352
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354353
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354354
+ WHERE c.contype = 'f'
354355
+ AND t1.relname = 'firms_other_advice_methods'
354356
+ AND t3.nspname = ANY (current_schemas(false))
354357
+ ORDER BY c.conname
354358
+
354359
+  (3.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354360
+ FROM pg_constraint c
354361
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354362
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354363
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354364
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354365
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354366
+ WHERE c.contype = 'f'
354367
+ AND t1.relname = 'in_person_advice_methods'
354368
+ AND t3.nspname = ANY (current_schemas(false))
354369
+ ORDER BY c.conname
354370
+ 
354371
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354372
+ FROM pg_constraint c
354373
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354374
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354375
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354376
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354377
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354378
+ WHERE c.contype = 'f'
354379
+ AND t1.relname = 'initial_advice_fee_structures'
354380
+ AND t3.nspname = ANY (current_schemas(false))
354381
+ ORDER BY c.conname
354382
+
354383
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354384
+ FROM pg_constraint c
354385
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354386
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354387
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354388
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354389
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354390
+ WHERE c.contype = 'f'
354391
+ AND t1.relname = 'initial_meeting_durations'
354392
+ AND t3.nspname = ANY (current_schemas(false))
354393
+ ORDER BY c.conname
354394
+ 
354395
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354396
+ FROM pg_constraint c
354397
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354398
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354399
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354400
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354401
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354402
+ WHERE c.contype = 'f'
354403
+ AND t1.relname = 'investment_sizes'
354404
+ AND t3.nspname = ANY (current_schemas(false))
354405
+ ORDER BY c.conname
354406
+
354407
+  (4.4ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354408
+ FROM pg_constraint c
354409
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354410
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354411
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354412
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354413
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354414
+ WHERE c.contype = 'f'
354415
+ AND t1.relname = 'lookup_advisers'
354416
+ AND t3.nspname = ANY (current_schemas(false))
354417
+ ORDER BY c.conname
354418
+ 
354419
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354420
+ FROM pg_constraint c
354421
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354422
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354423
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354424
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354425
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354426
+ WHERE c.contype = 'f'
354427
+ AND t1.relname = 'lookup_firms'
354428
+ AND t3.nspname = ANY (current_schemas(false))
354429
+ ORDER BY c.conname
354430
+
354431
+  (3.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354432
+ FROM pg_constraint c
354433
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354434
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354435
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354436
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354437
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354438
+ WHERE c.contype = 'f'
354439
+ AND t1.relname = 'lookup_subsidiaries'
354440
+ AND t3.nspname = ANY (current_schemas(false))
354441
+ ORDER BY c.conname
354442
+ 
354443
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354444
+ FROM pg_constraint c
354445
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354446
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354447
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354448
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354449
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354450
+ WHERE c.contype = 'f'
354451
+ AND t1.relname = 'old_passwords'
354452
+ AND t3.nspname = ANY (current_schemas(false))
354453
+ ORDER BY c.conname
354454
+
354455
+  (3.5ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354456
+ FROM pg_constraint c
354457
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354458
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354459
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354460
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354461
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354462
+ WHERE c.contype = 'f'
354463
+ AND t1.relname = 'ongoing_advice_fee_structures'
354464
+ AND t3.nspname = ANY (current_schemas(false))
354465
+ ORDER BY c.conname
354466
+ 
354467
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354468
+ FROM pg_constraint c
354469
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354470
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354471
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354472
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354473
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354474
+ WHERE c.contype = 'f'
354475
+ AND t1.relname = 'other_advice_methods'
354476
+ AND t3.nspname = ANY (current_schemas(false))
354477
+ ORDER BY c.conname
354478
+
354479
+  (3.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354480
+ FROM pg_constraint c
354481
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354482
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354483
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354484
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354485
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354486
+ WHERE c.contype = 'f'
354487
+ AND t1.relname = 'principals'
354488
+ AND t3.nspname = ANY (current_schemas(false))
354489
+ ORDER BY c.conname
354490
+ 
354491
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354492
+ FROM pg_constraint c
354493
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354494
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354495
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354496
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354497
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354498
+ WHERE c.contype = 'f'
354499
+ AND t1.relname = 'professional_bodies'
354500
+ AND t3.nspname = ANY (current_schemas(false))
354501
+ ORDER BY c.conname
354502
+
354503
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354504
+ FROM pg_constraint c
354505
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354506
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354507
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354508
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354509
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354510
+ WHERE c.contype = 'f'
354511
+ AND t1.relname = 'professional_standings'
354512
+ AND t3.nspname = ANY (current_schemas(false))
354513
+ ORDER BY c.conname
354514
+ 
354515
+  (2.9ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354516
+ FROM pg_constraint c
354517
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354518
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354519
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354520
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354521
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354522
+ WHERE c.contype = 'f'
354523
+ AND t1.relname = 'qualifications'
354524
+ AND t3.nspname = ANY (current_schemas(false))
354525
+ ORDER BY c.conname
354526
+
354527
+  (3.4ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354528
+ FROM pg_constraint c
354529
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354530
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354531
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354532
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354533
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354534
+ WHERE c.contype = 'f'
354535
+ AND t1.relname = 'users'
354536
+ AND t3.nspname = ANY (current_schemas(false))
354537
+ ORDER BY c.conname
354538
+ 
354539
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
354540
+ Migrating to AddStatusToAdvisers (20150810125558)
354541
+  (0.2ms) BEGIN
354542
+  (2.5ms) ALTER TABLE "advisers" ADD "status" integer
354543
+ SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150810125558"]]
354544
+  (1.2ms) COMMIT
354545
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
354546
+  (4.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354547
+ FROM pg_constraint c
354548
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354549
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354550
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354551
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354552
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354553
+ WHERE c.contype = 'f'
354554
+ AND t1.relname = 'accreditations'
354555
+ AND t3.nspname = ANY (current_schemas(false))
354556
+ ORDER BY c.conname
354557
+ 
354558
+  (3.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354559
+ FROM pg_constraint c
354560
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354561
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354562
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354563
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354564
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354565
+ WHERE c.contype = 'f'
354566
+ AND t1.relname = 'accreditations_advisers'
354567
+ AND t3.nspname = ANY (current_schemas(false))
354568
+ ORDER BY c.conname
354569
+
354570
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354571
+ FROM pg_constraint c
354572
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354573
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354574
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354575
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354576
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354577
+ WHERE c.contype = 'f'
354578
+ AND t1.relname = 'advisers'
354579
+ AND t3.nspname = ANY (current_schemas(false))
354580
+ ORDER BY c.conname
354581
+ 
354582
+  (3.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354583
+ FROM pg_constraint c
354584
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354585
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354586
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354587
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354588
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354589
+ WHERE c.contype = 'f'
354590
+ AND t1.relname = 'advisers_professional_bodies'
354591
+ AND t3.nspname = ANY (current_schemas(false))
354592
+ ORDER BY c.conname
354593
+
354594
+  (3.5ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354595
+ FROM pg_constraint c
354596
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354597
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354598
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354599
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354600
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354601
+ WHERE c.contype = 'f'
354602
+ AND t1.relname = 'advisers_professional_standings'
354603
+ AND t3.nspname = ANY (current_schemas(false))
354604
+ ORDER BY c.conname
354605
+ 
354606
+  (3.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354607
+ FROM pg_constraint c
354608
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354609
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354610
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354611
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354612
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354613
+ WHERE c.contype = 'f'
354614
+ AND t1.relname = 'advisers_qualifications'
354615
+ AND t3.nspname = ANY (current_schemas(false))
354616
+ ORDER BY c.conname
354617
+
354618
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354619
+ FROM pg_constraint c
354620
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354621
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354622
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354623
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354624
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354625
+ WHERE c.contype = 'f'
354626
+ AND t1.relname = 'allowed_payment_methods'
354627
+ AND t3.nspname = ANY (current_schemas(false))
354628
+ ORDER BY c.conname
354629
+ 
354630
+  (3.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354631
+ FROM pg_constraint c
354632
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354633
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354634
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354635
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354636
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354637
+ WHERE c.contype = 'f'
354638
+ AND t1.relname = 'allowed_payment_methods_firms'
354639
+ AND t3.nspname = ANY (current_schemas(false))
354640
+ ORDER BY c.conname
354641
+
354642
+  (3.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354643
+ FROM pg_constraint c
354644
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354645
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354646
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354647
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354648
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354649
+ WHERE c.contype = 'f'
354650
+ AND t1.relname = 'firms'
354651
+ AND t3.nspname = ANY (current_schemas(false))
354652
+ ORDER BY c.conname
354653
+ 
354654
+  (3.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354655
+ FROM pg_constraint c
354656
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354657
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354658
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354659
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354660
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354661
+ WHERE c.contype = 'f'
354662
+ AND t1.relname = 'firms_in_person_advice_methods'
354663
+ AND t3.nspname = ANY (current_schemas(false))
354664
+ ORDER BY c.conname
354665
+
354666
+  (3.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354667
+ FROM pg_constraint c
354668
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354669
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354670
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354671
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354672
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354673
+ WHERE c.contype = 'f'
354674
+ AND t1.relname = 'firms_initial_advice_fee_structures'
354675
+ AND t3.nspname = ANY (current_schemas(false))
354676
+ ORDER BY c.conname
354677
+ 
354678
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354679
+ FROM pg_constraint c
354680
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354681
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354682
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354683
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354684
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354685
+ WHERE c.contype = 'f'
354686
+ AND t1.relname = 'firms_investment_sizes'
354687
+ AND t3.nspname = ANY (current_schemas(false))
354688
+ ORDER BY c.conname
354689
+
354690
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354691
+ FROM pg_constraint c
354692
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354693
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354694
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354695
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354696
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354697
+ WHERE c.contype = 'f'
354698
+ AND t1.relname = 'firms_ongoing_advice_fee_structures'
354699
+ AND t3.nspname = ANY (current_schemas(false))
354700
+ ORDER BY c.conname
354701
+ 
354702
+  (3.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354703
+ FROM pg_constraint c
354704
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354705
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354706
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354707
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354708
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354709
+ WHERE c.contype = 'f'
354710
+ AND t1.relname = 'firms_other_advice_methods'
354711
+ AND t3.nspname = ANY (current_schemas(false))
354712
+ ORDER BY c.conname
354713
+
354714
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354715
+ FROM pg_constraint c
354716
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354717
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354718
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354719
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354720
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354721
+ WHERE c.contype = 'f'
354722
+ AND t1.relname = 'in_person_advice_methods'
354723
+ AND t3.nspname = ANY (current_schemas(false))
354724
+ ORDER BY c.conname
354725
+ 
354726
+  (3.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354727
+ FROM pg_constraint c
354728
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354729
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354730
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354731
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354732
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354733
+ WHERE c.contype = 'f'
354734
+ AND t1.relname = 'initial_advice_fee_structures'
354735
+ AND t3.nspname = ANY (current_schemas(false))
354736
+ ORDER BY c.conname
354737
+
354738
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354739
+ FROM pg_constraint c
354740
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354741
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354742
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354743
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354744
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354745
+ WHERE c.contype = 'f'
354746
+ AND t1.relname = 'initial_meeting_durations'
354747
+ AND t3.nspname = ANY (current_schemas(false))
354748
+ ORDER BY c.conname
354749
+ 
354750
+  (3.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354751
+ FROM pg_constraint c
354752
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354753
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354754
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354755
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354756
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354757
+ WHERE c.contype = 'f'
354758
+ AND t1.relname = 'investment_sizes'
354759
+ AND t3.nspname = ANY (current_schemas(false))
354760
+ ORDER BY c.conname
354761
+
354762
+  (3.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354763
+ FROM pg_constraint c
354764
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354765
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354766
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354767
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354768
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354769
+ WHERE c.contype = 'f'
354770
+ AND t1.relname = 'lookup_advisers'
354771
+ AND t3.nspname = ANY (current_schemas(false))
354772
+ ORDER BY c.conname
354773
+ 
354774
+  (3.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354775
+ FROM pg_constraint c
354776
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354777
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354778
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354779
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354780
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354781
+ WHERE c.contype = 'f'
354782
+ AND t1.relname = 'lookup_firms'
354783
+ AND t3.nspname = ANY (current_schemas(false))
354784
+ ORDER BY c.conname
354785
+
354786
+  (3.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354787
+ FROM pg_constraint c
354788
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354789
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354790
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354791
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354792
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354793
+ WHERE c.contype = 'f'
354794
+ AND t1.relname = 'lookup_subsidiaries'
354795
+ AND t3.nspname = ANY (current_schemas(false))
354796
+ ORDER BY c.conname
354797
+ 
354798
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354799
+ FROM pg_constraint c
354800
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354801
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354802
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354803
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354804
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354805
+ WHERE c.contype = 'f'
354806
+ AND t1.relname = 'old_passwords'
354807
+ AND t3.nspname = ANY (current_schemas(false))
354808
+ ORDER BY c.conname
354809
+
354810
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354811
+ FROM pg_constraint c
354812
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354813
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354814
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354815
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354816
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354817
+ WHERE c.contype = 'f'
354818
+ AND t1.relname = 'ongoing_advice_fee_structures'
354819
+ AND t3.nspname = ANY (current_schemas(false))
354820
+ ORDER BY c.conname
354821
+ 
354822
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354823
+ FROM pg_constraint c
354824
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354825
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354826
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354827
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354828
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354829
+ WHERE c.contype = 'f'
354830
+ AND t1.relname = 'other_advice_methods'
354831
+ AND t3.nspname = ANY (current_schemas(false))
354832
+ ORDER BY c.conname
354833
+
354834
+  (3.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354835
+ FROM pg_constraint c
354836
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354837
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354838
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354839
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354840
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354841
+ WHERE c.contype = 'f'
354842
+ AND t1.relname = 'principals'
354843
+ AND t3.nspname = ANY (current_schemas(false))
354844
+ ORDER BY c.conname
354845
+ 
354846
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354847
+ FROM pg_constraint c
354848
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354849
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354850
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354851
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354852
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354853
+ WHERE c.contype = 'f'
354854
+ AND t1.relname = 'professional_bodies'
354855
+ AND t3.nspname = ANY (current_schemas(false))
354856
+ ORDER BY c.conname
354857
+
354858
+  (3.5ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354859
+ FROM pg_constraint c
354860
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354861
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354862
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354863
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354864
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354865
+ WHERE c.contype = 'f'
354866
+ AND t1.relname = 'professional_standings'
354867
+ AND t3.nspname = ANY (current_schemas(false))
354868
+ ORDER BY c.conname
354869
+ 
354870
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354871
+ FROM pg_constraint c
354872
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354873
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354874
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354875
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354876
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354877
+ WHERE c.contype = 'f'
354878
+ AND t1.relname = 'qualifications'
354879
+ AND t3.nspname = ANY (current_schemas(false))
354880
+ ORDER BY c.conname
354881
+
354882
+  (3.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
354883
+ FROM pg_constraint c
354884
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354885
+ JOIN pg_class t2 ON c.confrelid = t2.oid
354886
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
354887
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
354888
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
354889
+ WHERE c.contype = 'f'
354890
+ AND t1.relname = 'users'
354891
+ AND t3.nspname = ANY (current_schemas(false))
354892
+ ORDER BY c.conname
354893
+ 
354894
+ Adviser Load (1.3ms) SELECT "advisers".* FROM "advisers" ORDER BY "advisers"."id" ASC LIMIT 1
354895
+ Adviser Load (1.0ms) SELECT "advisers".* FROM "advisers" ORDER BY "advisers"."id" ASC LIMIT 1
354896
+ Adviser Load (0.3ms) SELECT "advisers".* FROM "advisers" WHERE "advisers"."id" = $1 LIMIT 1 [["id", 14]]
354897
+ Adviser Load (0.6ms) SELECT "advisers".* FROM "advisers" ORDER BY "advisers"."id" ASC LIMIT 1
354898
+ Lookup::Adviser Load (1.0ms) SELECT "lookup_advisers".* FROM "lookup_advisers" WHERE "lookup_advisers"."reference_number" = $1 LIMIT 1 [["reference_number", "GXK01203"]]
354899
+ Adviser Exists (2.9ms) SELECT 1 AS one FROM "advisers" WHERE ("advisers"."reference_number" = 'GXK01203' AND "advisers"."id" != 14) LIMIT 1
354900
+ Lookup::Adviser Exists (0.9ms) SELECT 1 AS one FROM "lookup_advisers" WHERE "lookup_advisers"."reference_number" = $1 LIMIT 1 [["reference_number", "GXK01203"]]
354901
+  (5045.0ms) DROP DATABASE IF EXISTS "rad_development"
354902
+ PG::ObjectInUse: ERROR: database "rad_development" is being accessed by other users
354903
+ DETAIL: There is 1 other session using the database.
354904
+ : DROP DATABASE IF EXISTS "rad_development"
354905
+  (132.7ms) DROP DATABASE IF EXISTS "rad_core_test"
354906
+  (0.4ms) CREATE DATABASE "rad_development" ENCODING = 'utf8'
354907
+ PG::DuplicateDatabase: ERROR: database "rad_development" already exists
354908
+ : CREATE DATABASE "rad_development" ENCODING = 'utf8'
354909
+  (347.6ms) CREATE DATABASE "rad_core_test" ENCODING = 'utf8'
354910
+ SQL (0.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
354911
+  (5.8ms) DROP TABLE "accreditations" CASCADE
354912
+  (8.1ms) CREATE TABLE "accreditations" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "order" integer DEFAULT 0 NOT NULL) 
354913
+  (1.5ms) DROP TABLE "accreditations_advisers" CASCADE
354914
+  (1.0ms) CREATE TABLE "accreditations_advisers" ("adviser_id" integer NOT NULL, "accreditation_id" integer NOT NULL) 
354915
+  (1.6ms) CREATE UNIQUE INDEX "advisers_accreditations_index" ON "accreditations_advisers" USING btree ("adviser_id", "accreditation_id")
354916
+  (3.8ms) DROP TABLE "advisers" CASCADE
354917
+  (5.8ms) CREATE TABLE "advisers" ("id" serial primary key, "reference_number" character varying NOT NULL, "name" character varying NOT NULL, "firm_id" integer NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "postcode" character varying DEFAULT '' NOT NULL, "travel_distance" integer DEFAULT 0 NOT NULL, "latitude" float, "longitude" float, "status" integer)
354918
+  (1.3ms) DROP TABLE "advisers_professional_bodies" CASCADE
354919
+  (1.0ms) CREATE TABLE "advisers_professional_bodies" ("adviser_id" integer NOT NULL, "professional_body_id" integer NOT NULL)
354920
+  (1.2ms) CREATE UNIQUE INDEX "advisers_professional_bodies_index" ON "advisers_professional_bodies" USING btree ("adviser_id", "professional_body_id")
354921
+  (1.1ms) DROP TABLE "advisers_professional_standings" CASCADE
354922
+  (0.9ms) CREATE TABLE "advisers_professional_standings" ("adviser_id" integer NOT NULL, "professional_standing_id" integer NOT NULL) 
354923
+  (1.3ms) CREATE UNIQUE INDEX "advisers_professional_standings_index" ON "advisers_professional_standings" USING btree ("adviser_id", "professional_standing_id")
354924
+  (1.5ms) DROP TABLE "advisers_qualifications" CASCADE
354925
+  (1.7ms) CREATE TABLE "advisers_qualifications" ("adviser_id" integer NOT NULL, "qualification_id" integer NOT NULL)
354926
+  (2.0ms) CREATE UNIQUE INDEX "advisers_qualifications_index" ON "advisers_qualifications" USING btree ("adviser_id", "qualification_id")
354927
+  (3.3ms) DROP TABLE "allowed_payment_methods" CASCADE
354928
+  (3.7ms) CREATE TABLE "allowed_payment_methods" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "order" integer DEFAULT 0 NOT NULL) 
354929
+  (1.4ms) DROP TABLE "allowed_payment_methods_firms" CASCADE
354930
+  (1.4ms) CREATE TABLE "allowed_payment_methods_firms" ("firm_id" integer NOT NULL, "allowed_payment_method_id" integer NOT NULL) 
354931
+  (1.1ms) CREATE UNIQUE INDEX "firms_allowed_payment_methods_index" ON "allowed_payment_methods_firms" USING btree ("firm_id", "allowed_payment_method_id")
354932
+  (4.7ms) DROP TABLE "firms" CASCADE
354933
+  (6.1ms) CREATE TABLE "firms" ("id" serial primary key, "fca_number" integer NOT NULL, "registered_name" character varying NOT NULL, "email_address" character varying, "telephone_number" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "address_line_one" character varying, "address_line_two" character varying, "address_town" character varying, "address_county" character varying, "address_postcode" character varying, "free_initial_meeting" boolean, "initial_meeting_duration_id" integer, "minimum_fixed_fee" integer, "parent_id" integer, "latitude" float, "longitude" float, "retirement_income_products_flag" boolean DEFAULT 'f' NOT NULL, "pension_transfer_flag" boolean DEFAULT 'f' NOT NULL, "long_term_care_flag" boolean DEFAULT 'f' NOT NULL, "equity_release_flag" boolean DEFAULT 'f' NOT NULL, "inheritance_tax_and_estate_planning_flag" boolean DEFAULT 'f' NOT NULL, "wills_and_probate_flag" boolean DEFAULT 'f' NOT NULL, "website_address" character varying, "ethical_investing_flag" boolean DEFAULT 'f' NOT NULL, "sharia_investing_flag" boolean DEFAULT 'f' NOT NULL)
354934
+  (1.1ms) CREATE INDEX "index_firms_on_initial_meeting_duration_id" ON "firms" USING btree ("initial_meeting_duration_id")
354935
+  (1.3ms) DROP TABLE "firms_in_person_advice_methods" CASCADE
354936
+  (1.6ms) CREATE TABLE "firms_in_person_advice_methods" ("firm_id" integer NOT NULL, "in_person_advice_method_id" integer NOT NULL) 
354937
+  (1.2ms) CREATE UNIQUE INDEX "firms_in_person_advice_methods_index" ON "firms_in_person_advice_methods" USING btree ("firm_id", "in_person_advice_method_id")
354938
+  (2.3ms) DROP TABLE "firms_initial_advice_fee_structures" CASCADE
354939
+  (1.1ms) CREATE TABLE "firms_initial_advice_fee_structures" ("firm_id" integer NOT NULL, "initial_advice_fee_structure_id" integer NOT NULL)
354940
+  (1.8ms) CREATE UNIQUE INDEX "firms_initial_advice_fee_structures_index" ON "firms_initial_advice_fee_structures" USING btree ("firm_id", "initial_advice_fee_structure_id")
354941
+  (1.1ms) DROP TABLE "firms_investment_sizes" CASCADE
354942
+  (0.9ms) CREATE TABLE "firms_investment_sizes" ("firm_id" integer NOT NULL, "investment_size_id" integer NOT NULL) 
354943
+  (1.1ms) CREATE UNIQUE INDEX "firms_investment_sizes_index" ON "firms_investment_sizes" USING btree ("firm_id", "investment_size_id")
354944
+  (1.2ms) DROP TABLE "firms_ongoing_advice_fee_structures" CASCADE
354945
+  (0.9ms) CREATE TABLE "firms_ongoing_advice_fee_structures" ("firm_id" integer NOT NULL, "ongoing_advice_fee_structure_id" integer NOT NULL)
354946
+  (1.3ms) CREATE UNIQUE INDEX "firms_ongoing_advice_fee_structures_index" ON "firms_ongoing_advice_fee_structures" USING btree ("firm_id", "ongoing_advice_fee_structure_id")
354947
+  (1.2ms) DROP TABLE "firms_other_advice_methods" CASCADE
354948
+  (1.5ms) CREATE TABLE "firms_other_advice_methods" ("firm_id" integer NOT NULL, "other_advice_method_id" integer NOT NULL) 
354949
+  (1.2ms) CREATE UNIQUE INDEX "firms_other_advice_methods_index" ON "firms_other_advice_methods" USING btree ("firm_id", "other_advice_method_id")
354950
+  (3.3ms) DROP TABLE "in_person_advice_methods" CASCADE
354951
+  (5.3ms) CREATE TABLE "in_person_advice_methods" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "order" integer DEFAULT 0 NOT NULL)
354952
+  (2.4ms) DROP TABLE "initial_advice_fee_structures" CASCADE
354953
+  (3.7ms) CREATE TABLE "initial_advice_fee_structures" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "order" integer DEFAULT 0 NOT NULL)
354954
+  (2.3ms) DROP TABLE "initial_meeting_durations" CASCADE
354955
+  (3.8ms) CREATE TABLE "initial_meeting_durations" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "order" integer DEFAULT 0 NOT NULL)
354956
+  (2.4ms) DROP TABLE "investment_sizes" CASCADE
354957
+  (4.4ms) CREATE TABLE "investment_sizes" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "order" integer DEFAULT 0 NOT NULL, "cy_name" character varying)
354958
+  (3.6ms) DROP TABLE "lookup_advisers" CASCADE
354959
+  (4.2ms) CREATE TABLE "lookup_advisers" ("id" serial primary key, "reference_number" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
354960
+  (1.3ms) CREATE UNIQUE INDEX "index_lookup_advisers_on_reference_number" ON "lookup_advisers" USING btree ("reference_number")
354961
+  (3.8ms) DROP TABLE "lookup_firms" CASCADE
354962
+  (6.4ms) CREATE TABLE "lookup_firms" ("id" serial primary key, "fca_number" integer NOT NULL, "registered_name" character varying DEFAULT '' NOT NULL, "created_at" timestamp, "updated_at" timestamp) 
354963
+  (1.1ms) CREATE UNIQUE INDEX "index_lookup_firms_on_fca_number" ON "lookup_firms" USING btree ("fca_number")
354964
+  (3.1ms) DROP TABLE "lookup_subsidiaries" CASCADE
354965
+  (4.5ms) CREATE TABLE "lookup_subsidiaries" ("id" serial primary key, "fca_number" integer NOT NULL, "name" character varying DEFAULT '' NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
354966
+  (1.2ms) CREATE INDEX "index_lookup_subsidiaries_on_fca_number" ON "lookup_subsidiaries" USING btree ("fca_number")
354967
+  (2.2ms) DROP TABLE "ongoing_advice_fee_structures" CASCADE
354968
+  (4.1ms) CREATE TABLE "ongoing_advice_fee_structures" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "order" integer DEFAULT 0 NOT NULL) 
354969
+  (2.8ms) DROP TABLE "other_advice_methods" CASCADE
354970
+  (4.9ms) CREATE TABLE "other_advice_methods" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "order" integer DEFAULT 0 NOT NULL, "cy_name" character varying) 
354971
+  (2.5ms) DROP TABLE "principals" CASCADE
354972
+  (3.7ms) CREATE TABLE "principals" ("id" serial primary key, "fca_number" integer, "token" character varying, "first_name" character varying, "last_name" character varying, "job_title" character varying, "email_address" character varying, "telephone_number" character varying, "confirmed_disclaimer" boolean DEFAULT 'f', "created_at" timestamp, "updated_at" timestamp) 
354973
+  (1.2ms) CREATE UNIQUE INDEX "index_principals_on_fca_number" ON "principals" USING btree ("fca_number")
354974
+  (1.2ms) CREATE UNIQUE INDEX "index_principals_on_token" ON "principals" USING btree ("token")
354975
+  (2.4ms) DROP TABLE "professional_bodies" CASCADE
354976
+  (6.8ms) CREATE TABLE "professional_bodies" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "order" integer DEFAULT 0 NOT NULL) 
354977
+  (3.2ms) DROP TABLE "professional_standings" CASCADE
354978
+  (4.3ms) CREATE TABLE "professional_standings" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "order" integer DEFAULT 0 NOT NULL) 
354979
+  (2.2ms) DROP TABLE "qualifications" CASCADE
354980
+  (4.6ms) CREATE TABLE "qualifications" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "order" integer DEFAULT 0 NOT NULL) 
354981
+  (0.4ms) SELECT version FROM "schema_migrations"
354982
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20150813103046')
354983
+ SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
354984
+  (10.2ms) CREATE TABLE "accreditations" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "order" integer DEFAULT 0 NOT NULL) 
354985
+  (1.8ms) CREATE TABLE "accreditations_advisers" ("adviser_id" integer NOT NULL, "accreditation_id" integer NOT NULL)
354986
+  (1.6ms) CREATE UNIQUE INDEX "advisers_accreditations_index" ON "accreditations_advisers" USING btree ("adviser_id", "accreditation_id")
354987
+  (7.5ms) CREATE TABLE "advisers" ("id" serial primary key, "reference_number" character varying NOT NULL, "name" character varying NOT NULL, "firm_id" integer NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "postcode" character varying DEFAULT '' NOT NULL, "travel_distance" integer DEFAULT 0 NOT NULL, "latitude" float, "longitude" float, "status" integer)
354988
+  (1.7ms) CREATE TABLE "advisers_professional_bodies" ("adviser_id" integer NOT NULL, "professional_body_id" integer NOT NULL) 
354989
+  (1.3ms) CREATE UNIQUE INDEX "advisers_professional_bodies_index" ON "advisers_professional_bodies" USING btree ("adviser_id", "professional_body_id")
354990
+  (1.1ms) CREATE TABLE "advisers_professional_standings" ("adviser_id" integer NOT NULL, "professional_standing_id" integer NOT NULL) 
354991
+  (1.4ms) CREATE UNIQUE INDEX "advisers_professional_standings_index" ON "advisers_professional_standings" USING btree ("adviser_id", "professional_standing_id")
354992
+  (1.1ms) CREATE TABLE "advisers_qualifications" ("adviser_id" integer NOT NULL, "qualification_id" integer NOT NULL) 
354993
+  (1.2ms) CREATE UNIQUE INDEX "advisers_qualifications_index" ON "advisers_qualifications" USING btree ("adviser_id", "qualification_id")
354994
+  (4.8ms) CREATE TABLE "allowed_payment_methods" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "order" integer DEFAULT 0 NOT NULL) 
354995
+  (1.7ms) CREATE TABLE "allowed_payment_methods_firms" ("firm_id" integer NOT NULL, "allowed_payment_method_id" integer NOT NULL)
354996
+  (1.9ms) CREATE UNIQUE INDEX "firms_allowed_payment_methods_index" ON "allowed_payment_methods_firms" USING btree ("firm_id", "allowed_payment_method_id")
354997
+  (5.0ms) CREATE TABLE "firms" ("id" serial primary key, "fca_number" integer NOT NULL, "registered_name" character varying NOT NULL, "email_address" character varying, "telephone_number" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "address_line_one" character varying, "address_line_two" character varying, "address_town" character varying, "address_county" character varying, "address_postcode" character varying, "free_initial_meeting" boolean, "initial_meeting_duration_id" integer, "minimum_fixed_fee" integer, "parent_id" integer, "latitude" float, "longitude" float, "retirement_income_products_flag" boolean DEFAULT 'f' NOT NULL, "pension_transfer_flag" boolean DEFAULT 'f' NOT NULL, "long_term_care_flag" boolean DEFAULT 'f' NOT NULL, "equity_release_flag" boolean DEFAULT 'f' NOT NULL, "inheritance_tax_and_estate_planning_flag" boolean DEFAULT 'f' NOT NULL, "wills_and_probate_flag" boolean DEFAULT 'f' NOT NULL, "website_address" character varying, "ethical_investing_flag" boolean DEFAULT 'f' NOT NULL, "sharia_investing_flag" boolean DEFAULT 'f' NOT NULL)
354998
+  (1.2ms) CREATE INDEX "index_firms_on_initial_meeting_duration_id" ON "firms" USING btree ("initial_meeting_duration_id")
354999
+  (1.1ms) CREATE TABLE "firms_in_person_advice_methods" ("firm_id" integer NOT NULL, "in_person_advice_method_id" integer NOT NULL)
355000
+  (1.1ms) CREATE UNIQUE INDEX "firms_in_person_advice_methods_index" ON "firms_in_person_advice_methods" USING btree ("firm_id", "in_person_advice_method_id")
355001
+  (1.1ms) CREATE TABLE "firms_initial_advice_fee_structures" ("firm_id" integer NOT NULL, "initial_advice_fee_structure_id" integer NOT NULL)
355002
+  (1.3ms) CREATE UNIQUE INDEX "firms_initial_advice_fee_structures_index" ON "firms_initial_advice_fee_structures" USING btree ("firm_id", "initial_advice_fee_structure_id")
355003
+  (1.3ms) CREATE TABLE "firms_investment_sizes" ("firm_id" integer NOT NULL, "investment_size_id" integer NOT NULL)
355004
+  (1.2ms) CREATE UNIQUE INDEX "firms_investment_sizes_index" ON "firms_investment_sizes" USING btree ("firm_id", "investment_size_id")
355005
+  (1.1ms) CREATE TABLE "firms_ongoing_advice_fee_structures" ("firm_id" integer NOT NULL, "ongoing_advice_fee_structure_id" integer NOT NULL)
355006
+  (1.4ms) CREATE UNIQUE INDEX "firms_ongoing_advice_fee_structures_index" ON "firms_ongoing_advice_fee_structures" USING btree ("firm_id", "ongoing_advice_fee_structure_id")
355007
+  (1.0ms) CREATE TABLE "firms_other_advice_methods" ("firm_id" integer NOT NULL, "other_advice_method_id" integer NOT NULL)
355008
+  (1.3ms) CREATE UNIQUE INDEX "firms_other_advice_methods_index" ON "firms_other_advice_methods" USING btree ("firm_id", "other_advice_method_id")
355009
+  (6.1ms) CREATE TABLE "in_person_advice_methods" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "order" integer DEFAULT 0 NOT NULL)
355010
+  (6.0ms) CREATE TABLE "initial_advice_fee_structures" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "order" integer DEFAULT 0 NOT NULL) 
355011
+  (5.7ms) CREATE TABLE "initial_meeting_durations" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "order" integer DEFAULT 0 NOT NULL)
355012
+  (7.6ms) CREATE TABLE "investment_sizes" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "order" integer DEFAULT 0 NOT NULL, "cy_name" character varying) 
355013
+  (8.0ms) CREATE TABLE "lookup_advisers" ("id" serial primary key, "reference_number" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
355014
+  (2.3ms) CREATE UNIQUE INDEX "index_lookup_advisers_on_reference_number" ON "lookup_advisers" USING btree ("reference_number")
355015
+  (5.0ms) CREATE TABLE "lookup_firms" ("id" serial primary key, "fca_number" integer NOT NULL, "registered_name" character varying DEFAULT '' NOT NULL, "created_at" timestamp, "updated_at" timestamp)
355016
+  (1.7ms) CREATE UNIQUE INDEX "index_lookup_firms_on_fca_number" ON "lookup_firms" USING btree ("fca_number")
355017
+  (4.4ms) CREATE TABLE "lookup_subsidiaries" ("id" serial primary key, "fca_number" integer NOT NULL, "name" character varying DEFAULT '' NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
355018
+  (1.6ms) CREATE INDEX "index_lookup_subsidiaries_on_fca_number" ON "lookup_subsidiaries" USING btree ("fca_number")
355019
+  (5.8ms) CREATE TABLE "ongoing_advice_fee_structures" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "order" integer DEFAULT 0 NOT NULL)
355020
+  (8.2ms) CREATE TABLE "other_advice_methods" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "order" integer DEFAULT 0 NOT NULL, "cy_name" character varying) 
355021
+  (9.1ms) CREATE TABLE "principals" ("id" serial primary key, "fca_number" integer, "token" character varying, "first_name" character varying, "last_name" character varying, "job_title" character varying, "email_address" character varying, "telephone_number" character varying, "confirmed_disclaimer" boolean DEFAULT 'f', "created_at" timestamp, "updated_at" timestamp)
355022
+  (1.4ms) CREATE UNIQUE INDEX "index_principals_on_fca_number" ON "principals" USING btree ("fca_number")
355023
+  (1.4ms) CREATE UNIQUE INDEX "index_principals_on_token" ON "principals" USING btree ("token")
355024
+  (7.1ms) CREATE TABLE "professional_bodies" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "order" integer DEFAULT 0 NOT NULL) 
355025
+  (5.3ms) CREATE TABLE "professional_standings" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "order" integer DEFAULT 0 NOT NULL)
355026
+  (4.4ms) CREATE TABLE "qualifications" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "order" integer DEFAULT 0 NOT NULL) 
355027
+  (3.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL)
355028
+  (1.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
355029
+  (0.5ms) SELECT version FROM "schema_migrations"
355030
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20150813103046')
355031
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20141211110031')
355032
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20141221140208')
355033
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20141222150416')
355034
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20141230112136')
355035
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150106115732')
355036
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150114144343')
355037
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150114151447')
355038
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150115130949')
355039
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150119102735')
355040
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20150119111754')
355041
+  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20150119114218')
355042
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20150119125208')
355043
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150119152325')
355044
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150119152336')
355045
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150120133717')
355046
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20150120141928')
355047
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20150120150738')
355048
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20150121110757')
355049
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20150121123437')
355050
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20150121134845')
355051
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20150121154458')
355052
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20150121173015')
355053
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20150121181341')
355054
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20150121183728')
355055
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150124124350')
355056
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150125145457')
355057
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150125164156')
355058
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150127084858')
355059
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150209144836')
355060
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150210113610')
355061
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150222092417')
355062
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150228095315')
355063
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150305150719')
355064
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150423154732')
355065
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150630143001')
355066
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150706102943')
355067
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150716123032')
355068
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150806143047')
355069
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"