mas-rad_core 0.0.95 → 0.0.96

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: 2d69336ba464137daf9b2b5c75caf488380f704e
4
- data.tar.gz: 96b5d9ddabcbb1d2f5fa22c9162c8fcd343ad999
3
+ metadata.gz: faeb68ce40e5a78b0271d13ca8781ba500612d12
4
+ data.tar.gz: c1d22f48fb0af550af797da593dbee649b1f11ac
5
5
  SHA512:
6
- metadata.gz: 99f998d199dffad79993f6c0b4c39f6998d06966b5aea5ba0522ab5b1efa032d77f45417fea8331f5045b20caf5b87bcad2ecdb1a21292aa7745e8402574702b
7
- data.tar.gz: 4419dfe1cd4c769a647c30a8d73436007174d157c230cfcf0c89a9f30d86b49935ff8908eb5eb94955bb1836947045f9f7a1c32226dc136b957887ccfeba52ae
6
+ metadata.gz: cf3875ada843c8ea3f078bc7da5d5d83604a928a1b2b4e95922d8bfc2a5f59961b0b047d1eb68ba726c3b37a9632abb660b8fc6fecc328f042875e8207ced3cd
7
+ data.tar.gz: ec84cbe93bcee8222680069ecf9c3bdd3dd63c1fbefd58aca06fa773815c28f837ef30f144365d99051263d39bedff771480cfcc07584ccce53d02c86feaac93
@@ -27,9 +27,9 @@ class Adviser < ActiveRecord::Base
27
27
  uniqueness: true,
28
28
  format: {
29
29
  with: /\A[A-Z]{3}[0-9]{5}\z/
30
- }
30
+ }, unless: :bypass_reference_number_check?
31
31
 
32
- validate :match_reference_number
32
+ validate :match_reference_number, unless: :bypass_reference_number_check?
33
33
 
34
34
  scope :sorted_by_name, -> { order(:name) }
35
35
 
@@ -93,7 +93,7 @@ class Adviser < ActiveRecord::Base
93
93
  end
94
94
 
95
95
  def assign_name
96
- self.name = Lookup::Adviser.find_by(
96
+ self.name = self.name || Lookup::Adviser.find_by(
97
97
  reference_number: reference_number
98
98
  ).try(:name)
99
99
  end
@@ -0,0 +1,5 @@
1
+ class AddBypassReferenceNumberCheckToAdvisers < ActiveRecord::Migration
2
+ def change
3
+ add_column :advisers, :bypass_reference_number_check, :boolean, default: false
4
+ end
5
+ end
@@ -1,5 +1,5 @@
1
1
  module MAS
2
2
  module RadCore
3
- VERSION = '0.0.95'
3
+ VERSION = '0.0.96'
4
4
  end
5
5
  end
@@ -6,7 +6,7 @@ default: &default
6
6
 
7
7
  development:
8
8
  <<: *default
9
- database: rad_development
9
+ database: rad_core_development
10
10
 
11
11
  test:
12
12
  <<: *default
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20151111132037) do
14
+ ActiveRecord::Schema.define(version: 20160205150033) do
15
15
 
16
16
  # These are extensions that must be enabled in order to support this database
17
17
  enable_extension "plpgsql"
@@ -31,15 +31,16 @@ ActiveRecord::Schema.define(version: 20151111132037) do
31
31
  add_index "accreditations_advisers", ["adviser_id", "accreditation_id"], name: "advisers_accreditations_index", unique: true, using: :btree
32
32
 
33
33
  create_table "advisers", force: :cascade do |t|
34
- t.string "reference_number", null: false
35
- t.string "name", null: false
36
- t.integer "firm_id", null: false
37
- t.datetime "created_at", null: false
38
- t.datetime "updated_at", null: false
39
- t.string "postcode", default: "", null: false
40
- t.integer "travel_distance", default: 0, null: false
34
+ t.string "reference_number", null: false
35
+ t.string "name", null: false
36
+ t.integer "firm_id", null: false
37
+ t.datetime "created_at", null: false
38
+ t.datetime "updated_at", null: false
39
+ t.string "postcode", default: "", null: false
40
+ t.integer "travel_distance", default: 0, null: false
41
41
  t.float "latitude"
42
42
  t.float "longitude"
43
+ t.boolean "bypass_reference_number_check", default: false
43
44
  end
44
45
 
45
46
  create_table "advisers_professional_bodies", id: false, force: :cascade do |t|
@@ -0,0 +1,1121 @@
1
+  (25.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
2
+  (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
4
+ Migrating to CreateLookupFirms (20141211110031)
5
+  (0.2ms) BEGIN
6
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/cazrin/code/cultivate/rad_core/db/migrate/20141211110031_create_lookup_firms.rb:8)
7
+  (19.9ms) 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) 
8
+  (0.9ms) CREATE UNIQUE INDEX "index_lookup_firms_on_fca_number" ON "lookup_firms" ("fca_number")
9
+ SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141211110031"]]
10
+  (6.2ms) COMMIT
11
+ Migrating to CreatePrincipals (20141221140208)
12
+  (6.0ms) BEGIN
13
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block (2 levels) in change at /Users/cazrin/code/cultivate/rad_core/db/migrate/20141221140208_create_principals.rb:19)
14
+  (14.8ms) CREATE TABLE "principals" ("id" serial primary key, "fca_number" integer, "token" character varying, "website_address" 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)
15
+  (0.8ms) CREATE UNIQUE INDEX "index_principals_on_fca_number" ON "principals" ("fca_number")
16
+  (1.0ms) CREATE UNIQUE INDEX "index_principals_on_token" ON "principals" ("token")
17
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141221140208"]]
18
+  (0.4ms) COMMIT
19
+ Migrating to AddLastSignInAtToPrincipal (20141222150416)
20
+  (6.1ms) BEGIN
21
+  (0.9ms) ALTER TABLE "principals" ADD "last_sign_in_at" timestamp
22
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141222150416"]]
23
+  (5.8ms) COMMIT
24
+ Migrating to CreateLookupSubsidiaries (20141230112136)
25
+  (0.2ms) BEGIN
26
+  (14.1ms) 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)
27
+  (6.4ms) CREATE INDEX "index_lookup_subsidiaries_on_fca_number" ON "lookup_subsidiaries" ("fca_number")
28
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141230112136"]]
29
+  (0.5ms) COMMIT
30
+ Migrating to RemoveLastSignInAtFromPrincipals (20150106115732)
31
+  (6.1ms) BEGIN
32
+  (6.4ms) ALTER TABLE "principals" DROP "last_sign_in_at"
33
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150106115732"]]
34
+  (5.6ms) COMMIT
35
+ Migrating to CreateLookupAdvisers (20150114144343)
36
+  (0.2ms) BEGIN
37
+  (14.4ms) 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) 
38
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150114144343"]]
39
+  (11.3ms) COMMIT
40
+ Migrating to CreateFirms (20150114151447)
41
+  (6.0ms) BEGIN
42
+  (13.8ms) 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) 
43
+  (5.0ms) CREATE UNIQUE INDEX "index_firms_on_fca_number" ON "firms" ("fca_number")
44
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150114151447"]]
45
+  (0.6ms) COMMIT
46
+ Migrating to AddAddressToFirm (20150115130949)
47
+  (6.7ms) BEGIN
48
+  (0.4ms) ALTER TABLE "firms" ADD "address_line_one" character varying
49
+  (0.3ms) ALTER TABLE "firms" ADD "address_line_two" character varying
50
+  (0.2ms) ALTER TABLE "firms" ADD "address_town" character varying
51
+  (0.2ms) ALTER TABLE "firms" ADD "address_county" character varying
52
+  (0.3ms) ALTER TABLE "firms" ADD "address_postcode" character varying
53
+ SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150115130949"]]
54
+  (5.8ms) COMMIT
55
+ Migrating to CreateInPersonAdviceMethods (20150119102735)
56
+  (0.2ms) BEGIN
57
+  (14.4ms) 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)
58
+  (1.0ms) CREATE TABLE "firms_in_person_advice_methods" ("firm_id" integer NOT NULL, "in_person_advice_method_id" integer NOT NULL) 
59
+  (6.7ms) CREATE UNIQUE INDEX "firms_in_person_advice_methods_index" ON "firms_in_person_advice_methods" ("firm_id", "in_person_advice_method_id")
60
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150119102735"]]
61
+  (0.5ms) COMMIT
62
+ Migrating to CreateOtherAdviceMethods (20150119111754)
63
+  (5.5ms) BEGIN
64
+  (18.6ms) CREATE TABLE "other_advice_methods" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
65
+  (0.8ms) CREATE TABLE "firms_other_advice_methods" ("firm_id" integer NOT NULL, "other_advice_method_id" integer NOT NULL) 
66
+  (1.0ms) CREATE UNIQUE INDEX "firms_other_advice_methods_index" ON "firms_other_advice_methods" ("firm_id", "other_advice_method_id")
67
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150119111754"]]
68
+  (0.6ms) COMMIT
69
+ Migrating to AddFreeInitialMeetingToFirm (20150119114218)
70
+  (5.9ms) BEGIN
71
+  (0.7ms) ALTER TABLE "firms" ADD "free_initial_meeting" boolean
72
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150119114218"]]
73
+  (5.7ms) COMMIT
74
+ Migrating to CreateInitialMeetingDurations (20150119125208)
75
+  (0.2ms) BEGIN
76
+  (14.0ms) CREATE TABLE "initial_meeting_durations" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
77
+  (0.4ms) ALTER TABLE "firms" ADD "initial_meeting_duration_id" integer
78
+  (6.8ms) CREATE INDEX "index_firms_on_initial_meeting_duration_id" ON "firms" ("initial_meeting_duration_id")
79
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150119125208"]]
80
+  (0.4ms) COMMIT
81
+ Migrating to CreateInitialAdviceFeeStructures (20150119152325)
82
+  (5.8ms) BEGIN
83
+  (15.4ms) 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)
84
+  (1.3ms) CREATE TABLE "firms_initial_advice_fee_structures" ("firm_id" integer NOT NULL, "initial_advice_fee_structure_id" integer NOT NULL) 
85
+  (1.4ms) CREATE UNIQUE INDEX "firms_initial_advice_fee_structures_index" ON "firms_initial_advice_fee_structures" ("firm_id", "initial_advice_fee_structure_id")
86
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150119152325"]]
87
+  (0.4ms) COMMIT
88
+ Migrating to CreateOngoingAdviceFeeStructures (20150119152336)
89
+  (5.9ms) BEGIN
90
+  (14.5ms) 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)
91
+  (151.9ms) CREATE TABLE "firms_ongoing_advice_fee_structures" ("firm_id" integer NOT NULL, "ongoing_advice_fee_structure_id" integer NOT NULL) 
92
+  (0.9ms) CREATE UNIQUE INDEX "firms_ongoing_advice_fee_structures_index" ON "firms_ongoing_advice_fee_structures" ("firm_id", "ongoing_advice_fee_structure_id")
93
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150119152336"]]
94
+  (0.6ms) COMMIT
95
+ Migrating to CreateAllowedPaymentMethods (20150120133717)
96
+  (9.8ms) BEGIN
97
+  (14.3ms) CREATE TABLE "allowed_payment_methods" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
98
+  (1.2ms) CREATE TABLE "allowed_payment_methods_firms" ("firm_id" integer NOT NULL, "allowed_payment_method_id" integer NOT NULL) 
99
+  (1.0ms) CREATE UNIQUE INDEX "firms_allowed_payment_methods_index" ON "allowed_payment_methods_firms" ("firm_id", "allowed_payment_method_id")
100
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150120133717"]]
101
+  (0.5ms) COMMIT
102
+ Migrating to AddMinimumFixedFeeToFirm (20150120141928)
103
+  (5.7ms) BEGIN
104
+  (0.4ms) ALTER TABLE "firms" ADD "minimum_fixed_fee" integer
105
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150120141928"]]
106
+  (5.8ms) COMMIT
107
+ Migrating to CreateInvestmentSizes (20150120150738)
108
+  (0.4ms) BEGIN
109
+  (14.9ms) CREATE TABLE "investment_sizes" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
110
+  (0.9ms) CREATE TABLE "firms_investment_sizes" ("firm_id" integer NOT NULL, "investment_size_id" integer NOT NULL) 
111
+  (5.0ms) CREATE UNIQUE INDEX "firms_investment_sizes_index" ON "firms_investment_sizes" ("firm_id", "investment_size_id")
112
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150120150738"]]
113
+  (0.4ms) COMMIT
114
+ Migrating to CreateAdvisers (20150121110757)
115
+  (6.2ms) BEGIN
116
+  (15.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)
117
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150121110757"]]
118
+  (0.5ms) COMMIT
119
+ Migrating to AddBusinessIncomeBreakdownFieldsToFirm (20150121123437)
120
+  (6.3ms) BEGIN
121
+  (0.4ms) ALTER TABLE "firms" ADD "retirement_income_products_percent" integer
122
+  (0.7ms) ALTER TABLE "firms" ADD "pension_transfer_percent" integer
123
+  (0.5ms) ALTER TABLE "firms" ADD "long_term_care_percent" integer
124
+  (0.5ms) ALTER TABLE "firms" ADD "equity_release_percent" integer
125
+  (0.3ms) ALTER TABLE "firms" ADD "inheritance_tax_and_estate_planning_percent" integer
126
+  (0.3ms) ALTER TABLE "firms" ADD "wills_and_probate_percent" integer
127
+  (0.2ms) ALTER TABLE "firms" ADD "other_percent" integer
128
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150121123437"]]
129
+  (6.0ms) COMMIT
130
+ Migrating to CreateQualifications (20150121134845)
131
+  (0.2ms) BEGIN
132
+  (14.1ms) CREATE TABLE "qualifications" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
133
+  (0.8ms) CREATE TABLE "advisers_qualifications" ("adviser_id" integer NOT NULL, "qualification_id" integer NOT NULL) 
134
+  (6.7ms) CREATE UNIQUE INDEX "advisers_qualifications_index" ON "advisers_qualifications" ("adviser_id", "qualification_id")
135
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150121134845"]]
136
+  (0.5ms) COMMIT
137
+ Migrating to CreateAccreditations (20150121154458)
138
+  (5.6ms) BEGIN
139
+  (15.3ms) CREATE TABLE "accreditations" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
140
+  (1.5ms) CREATE TABLE "accreditations_advisers" ("adviser_id" integer NOT NULL, "accreditation_id" integer NOT NULL) 
141
+  (0.9ms) CREATE UNIQUE INDEX "advisers_accreditations_index" ON "accreditations_advisers" ("adviser_id", "accreditation_id")
142
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150121154458"]]
143
+  (1.4ms) COMMIT
144
+ Migrating to CreateProfessionalStandings (20150121173015)
145
+  (5.5ms) BEGIN
146
+  (14.7ms) CREATE TABLE "professional_standings" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
147
+  (0.9ms) CREATE TABLE "advisers_professional_standings" ("adviser_id" integer NOT NULL, "professional_standing_id" integer NOT NULL) 
148
+  (1.0ms) CREATE UNIQUE INDEX "advisers_professional_standings_index" ON "advisers_professional_standings" ("adviser_id", "professional_standing_id")
149
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150121173015"]]
150
+  (0.4ms) COMMIT
151
+ Migrating to CreateProfessionalBodies (20150121181341)
152
+  (5.7ms) BEGIN
153
+  (15.2ms) CREATE TABLE "professional_bodies" ("id" serial primary key, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
154
+  (0.8ms) CREATE TABLE "advisers_professional_bodies" ("adviser_id" integer NOT NULL, "professional_body_id" integer NOT NULL) 
155
+  (1.9ms) CREATE UNIQUE INDEX "advisers_professional_bodies_index" ON "advisers_professional_bodies" ("adviser_id", "professional_body_id")
156
+ SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150121181341"]]
157
+  (0.5ms) COMMIT
158
+ Migrating to AddConfirmedDisclaimerToAdvisers (20150121183728)
159
+  (5.6ms) BEGIN
160
+  (0.4ms) ALTER TABLE "advisers" ADD "confirmed_disclaimer" boolean NOT NULL
161
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150121183728"]]
162
+  (6.0ms) COMMIT
163
+ Migrating to AddGeographicalFieldsToAdviser (20150124124350)
164
+  (0.2ms) BEGIN
165
+  (14.7ms) ALTER TABLE "advisers" ADD "postcode" character varying DEFAULT '' NOT NULL
166
+  (8.8ms) ALTER TABLE "advisers" ADD "travel_distance" integer DEFAULT 0 NOT NULL
167
+  (4.0ms) ALTER TABLE "advisers" ADD "covers_whole_of_uk" boolean DEFAULT 'f' NOT NULL
168
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150124124350"]]
169
+  (1.4ms) COMMIT
170
+ Migrating to AddParentIdToFirms (20150125145457)
171
+  (0.3ms) BEGIN
172
+  (0.4ms) ALTER TABLE "firms" ADD "parent_id" integer
173
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150125145457"]]
174
+  (6.0ms) COMMIT
175
+ Migrating to RemoveUniqueConstraintFromFirmsFcaNumber (20150125164156)
176
+  (0.4ms) BEGIN
177
+  (0.3ms) DROP INDEX "index_firms_on_fca_number"
178
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150125164156"]]
179
+  (6.1ms) COMMIT
180
+ Migrating to AddOrderingOnReferenceData (20150127084858)
181
+  (0.2ms) BEGIN
182
+  (14.8ms) ALTER TABLE "accreditations" ADD "order" integer DEFAULT 0 NOT NULL
183
+ Accreditation Load (0.5ms) SELECT "accreditations".* FROM "accreditations" ORDER BY "accreditations"."id" ASC
184
+  (7.3ms) ALTER TABLE "allowed_payment_methods" ADD "order" integer DEFAULT 0 NOT NULL
185
+ AllowedPaymentMethod Load (0.4ms) SELECT "allowed_payment_methods".* FROM "allowed_payment_methods" ORDER BY "allowed_payment_methods"."id" ASC
186
+  (3.1ms) ALTER TABLE "in_person_advice_methods" ADD "order" integer DEFAULT 0 NOT NULL
187
+ InPersonAdviceMethod Load (0.5ms) SELECT "in_person_advice_methods".* FROM "in_person_advice_methods" ORDER BY "in_person_advice_methods"."id" ASC
188
+  (7.6ms) ALTER TABLE "initial_advice_fee_structures" ADD "order" integer DEFAULT 0 NOT NULL
189
+ InitialAdviceFeeStructure Load (0.6ms) SELECT "initial_advice_fee_structures".* FROM "initial_advice_fee_structures" ORDER BY "initial_advice_fee_structures"."id" ASC
190
+  (4.0ms) ALTER TABLE "initial_meeting_durations" ADD "order" integer DEFAULT 0 NOT NULL
191
+ InitialMeetingDuration Load (0.5ms) SELECT "initial_meeting_durations".* FROM "initial_meeting_durations" ORDER BY "initial_meeting_durations"."id" ASC
192
+  (3.6ms) ALTER TABLE "investment_sizes" ADD "order" integer DEFAULT 0 NOT NULL
193
+ InvestmentSize Load (0.5ms) SELECT "investment_sizes".* FROM "investment_sizes" ORDER BY "investment_sizes"."id" ASC
194
+  (3.2ms) ALTER TABLE "ongoing_advice_fee_structures" ADD "order" integer DEFAULT 0 NOT NULL
195
+ OngoingAdviceFeeStructure Load (0.4ms) SELECT "ongoing_advice_fee_structures".* FROM "ongoing_advice_fee_structures" ORDER BY "ongoing_advice_fee_structures"."id" ASC
196
+  (4.1ms) ALTER TABLE "other_advice_methods" ADD "order" integer DEFAULT 0 NOT NULL
197
+ OtherAdviceMethod Load (0.5ms) SELECT "other_advice_methods".* FROM "other_advice_methods" ORDER BY "other_advice_methods"."id" ASC
198
+  (3.7ms) ALTER TABLE "professional_bodies" ADD "order" integer DEFAULT 0 NOT NULL
199
+ ProfessionalBody Load (0.6ms) SELECT "professional_bodies".* FROM "professional_bodies" ORDER BY "professional_bodies"."id" ASC
200
+  (15.4ms) ALTER TABLE "professional_standings" ADD "order" integer DEFAULT 0 NOT NULL
201
+ ProfessionalStanding Load (0.8ms) SELECT "professional_standings".* FROM "professional_standings" ORDER BY "professional_standings"."id" ASC
202
+  (14.4ms) ALTER TABLE "qualifications" ADD "order" integer DEFAULT 0 NOT NULL
203
+ Qualification Load (0.4ms) SELECT "qualifications".* FROM "qualifications" ORDER BY "qualifications"."id" ASC
204
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150127084858"]]
205
+  (8.8ms) COMMIT
206
+ Migrating to RemoveCoversWholeOfUkFromAdvisers (20150209144836)
207
+  (0.5ms) BEGIN
208
+ Adviser Load (0.5ms) SELECT "advisers".* FROM "advisers" WHERE "advisers"."covers_whole_of_uk" = 't' ORDER BY "advisers"."id" ASC LIMIT 1000
209
+  (0.7ms) ALTER TABLE "advisers" DROP "covers_whole_of_uk"
210
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150209144836"]]
211
+  (5.6ms) COMMIT
212
+ Migrating to AddLatitudeAndLongitudeToFirm (20150210113610)
213
+  (0.2ms) BEGIN
214
+  (0.4ms) ALTER TABLE "firms" ADD "latitude" float
215
+  (0.3ms) ALTER TABLE "firms" ADD "longitude" float
216
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150210113610"]]
217
+  (5.7ms) COMMIT
218
+ Migrating to AddLatitudeAndLongitudeToAdvisers (20150222092417)
219
+  (0.2ms) BEGIN
220
+  (0.4ms) ALTER TABLE "advisers" ADD "latitude" float
221
+  (0.3ms) ALTER TABLE "advisers" ADD "longitude" float
222
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150222092417"]]
223
+  (6.0ms) COMMIT
224
+ Migrating to AddCyNameToOtherAdviceMethods (20150228095315)
225
+  (0.2ms) BEGIN
226
+  (0.4ms) ALTER TABLE "other_advice_methods" ADD "cy_name" character varying
227
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150228095315"]]
228
+  (6.0ms) COMMIT
229
+ Migrating to AddCyNameToInvestmentSize (20150305150719)
230
+  (0.2ms) BEGIN
231
+  (0.3ms) ALTER TABLE "investment_sizes" ADD "cy_name" character varying
232
+ InvestmentSize Load (0.5ms) SELECT "investment_sizes".* FROM "investment_sizes" ORDER BY "investment_sizes"."order" ASC
233
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150305150719"]]
234
+  (6.0ms) COMMIT
235
+ Migrating to AddIndexOnLookupAdvisersReferenceNumber (20150423154732)
236
+  (0.5ms) BEGIN
237
+  (7.0ms) CREATE UNIQUE INDEX "index_lookup_advisers_on_reference_number" ON "lookup_advisers" ("reference_number")
238
+ SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150423154732"]]
239
+  (5.6ms) COMMIT
240
+ Migrating to ChangePercentageFieldsToBooleanFieldsOnFirm (20150630143001)
241
+  (0.2ms) BEGIN
242
+  (21.0ms) ALTER TABLE "firms" ADD "retirement_income_products_flag" boolean DEFAULT 'f' NOT NULL
243
+ SQL (0.8ms) UPDATE "firms" SET "retirement_income_products_flag" = 't' WHERE (retirement_income_products_percent > 0)
244
+  (0.4ms) ALTER TABLE "firms" DROP "retirement_income_products_percent"
245
+  (6.0ms) ALTER TABLE "firms" ADD "pension_transfer_flag" boolean DEFAULT 'f' NOT NULL
246
+ SQL (0.4ms) UPDATE "firms" SET "pension_transfer_flag" = 't' WHERE (pension_transfer_percent > 0)
247
+  (0.5ms) ALTER TABLE "firms" DROP "pension_transfer_percent"
248
+  (4.3ms) ALTER TABLE "firms" ADD "long_term_care_flag" boolean DEFAULT 'f' NOT NULL
249
+ SQL (0.5ms) UPDATE "firms" SET "long_term_care_flag" = 't' WHERE (long_term_care_percent > 0)
250
+  (0.7ms) ALTER TABLE "firms" DROP "long_term_care_percent"
251
+  (8.2ms) ALTER TABLE "firms" ADD "equity_release_flag" boolean DEFAULT 'f' NOT NULL
252
+ SQL (0.5ms) UPDATE "firms" SET "equity_release_flag" = 't' WHERE (equity_release_percent > 0)
253
+  (0.4ms) ALTER TABLE "firms" DROP "equity_release_percent"
254
+  (5.0ms) ALTER TABLE "firms" ADD "inheritance_tax_and_estate_planning_flag" boolean DEFAULT 'f' NOT NULL
255
+ SQL (0.5ms) UPDATE "firms" SET "inheritance_tax_and_estate_planning_flag" = 't' WHERE (inheritance_tax_and_estate_planning_percent > 0)
256
+  (0.4ms) ALTER TABLE "firms" DROP "inheritance_tax_and_estate_planning_percent"
257
+  (5.5ms) ALTER TABLE "firms" ADD "wills_and_probate_flag" boolean DEFAULT 'f' NOT NULL
258
+ SQL (0.7ms) UPDATE "firms" SET "wills_and_probate_flag" = 't' WHERE (wills_and_probate_percent > 0)
259
+  (0.6ms) ALTER TABLE "firms" DROP "wills_and_probate_percent"
260
+  (7.4ms) ALTER TABLE "firms" ADD "other_flag" boolean DEFAULT 'f' NOT NULL
261
+ SQL (0.5ms) UPDATE "firms" SET "other_flag" = 't' WHERE (other_percent > 0)
262
+  (0.4ms) ALTER TABLE "firms" DROP "other_percent"
263
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150630143001"]]
264
+  (7.5ms) COMMIT
265
+ Migrating to MoveWebsiteFromPrincipalsToFirms (20150706102943)
266
+  (1.9ms) BEGIN
267
+  (1.3ms) ALTER TABLE "firms" ADD "website_address" character varying
268
+ Principal Load (0.8ms) SELECT "principals".* FROM "principals"
269
+  (0.4ms) ALTER TABLE "principals" DROP "website_address"
270
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150706102943"]]
271
+  (0.4ms) COMMIT
272
+ Migrating to RemoveOtherFlagFromFirms (20150716123032)
273
+  (0.2ms) BEGIN
274
+  (0.6ms) ALTER TABLE "firms" DROP "other_flag"
275
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150716123032"]]
276
+  (5.6ms) COMMIT
277
+ Migrating to AddInvestingCheckboxesToFirms (20150806143047)
278
+  (0.3ms) BEGIN
279
+  (22.1ms) ALTER TABLE "firms" ADD "ethical_investing_flag" boolean DEFAULT 'f' NOT NULL
280
+  (6.2ms) ALTER TABLE "firms" ADD "sharia_investing_flag" boolean DEFAULT 'f' NOT NULL
281
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150806143047"]]
282
+  (1.6ms) COMMIT
283
+ Migrating to AddLanguagesToFirm (20150807134551)
284
+  (0.3ms) BEGIN
285
+  (23.5ms) ALTER TABLE "firms" ADD "languages" text[] DEFAULT '{}' NOT NULL
286
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150807134551"]]
287
+  (1.1ms) COMMIT
288
+ Migrating to CreateOffices (20150812140642)
289
+  (0.3ms) BEGIN
290
+  (14.2ms) CREATE TABLE "offices" ("id" serial primary key, "address_line_one" character varying NOT NULL, "address_line_two" character varying, "address_town" character varying NOT NULL, "address_county" character varying, "address_postcode" character varying NOT NULL, "email_address" character varying, "telephone_number" character varying, "disabled_access" boolean DEFAULT 'f' NOT NULL, "firm_id" integer NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
291
+ SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150812140642"]]
292
+  (5.9ms) COMMIT
293
+ Migrating to RemoveConfirmedDisclaimerFromAdvisers (20150813103046)
294
+  (5.7ms) BEGIN
295
+  (0.4ms) ALTER TABLE "advisers" DROP "confirmed_disclaimer"
296
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150813103046"]]
297
+  (5.6ms) COMMIT
298
+ Migrating to AddStatusToFirms (20150817141257)
299
+  (0.2ms) BEGIN
300
+  (0.4ms) ALTER TABLE "firms" ADD "status" integer
301
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150817141257"]]
302
+  (6.5ms) COMMIT
303
+ Migrating to MoveFirmAddressToOffice (20150825090822)
304
+  (0.2ms) BEGIN
305
+ MoveFirmAddressToOffice::Firm Load (0.5ms) SELECT "firms".* FROM "firms" WHERE ("firms"."address_line_one" IS NOT NULL)
306
+  (0.4ms) ALTER TABLE "firms" DROP "address_line_one"
307
+  (0.2ms) ALTER TABLE "firms" DROP "address_line_two"
308
+  (0.3ms) ALTER TABLE "firms" DROP "address_town"
309
+  (0.2ms) ALTER TABLE "firms" DROP "address_county"
310
+  (0.3ms) ALTER TABLE "firms" DROP "address_postcode"
311
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150825090822"]]
312
+  (5.9ms) COMMIT
313
+ Migrating to RemoveFirmEmailAndPhone (20150930140851)
314
+  (0.2ms) BEGIN
315
+  (0.4ms) ALTER TABLE "firms" DROP "email_address"
316
+  (0.3ms) ALTER TABLE "firms" DROP "telephone_number"
317
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150930140851"]]
318
+  (6.2ms) COMMIT
319
+ Migrating to AddDefaultValueToMinimumFixedFee (20151102113518)
320
+  (0.2ms) BEGIN
321
+ AddDefaultValueToMinimumFixedFee::Firm Load (0.5ms) SELECT "firms".* FROM "firms" WHERE "firms"."minimum_fixed_fee" IS NULL
322
+  (0.4ms) ALTER TABLE "firms" ALTER COLUMN "minimum_fixed_fee" SET DEFAULT 0
323
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20151102113518"]]
324
+  (5.8ms) COMMIT
325
+ Migrating to AddLatitudeAndLongitudeToOffice (20151103161642)
326
+  (0.2ms) BEGIN
327
+  (0.4ms) ALTER TABLE "offices" ADD "latitude" float
328
+  (0.3ms) ALTER TABLE "offices" ADD "longitude" float
329
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20151103161642"]]
330
+  (5.8ms) COMMIT
331
+ Migrating to RemoveLatitudeAndLongitudeFromFirm (20151111132037)
332
+  (0.2ms) BEGIN
333
+ RemoveLatitudeAndLongitudeFromFirm::Firm Load (1.5ms) SELECT "firms".* FROM "firms" WHERE ("firms"."latitude" IS NOT NULL) AND ("firms"."longitude" IS NOT NULL) ORDER BY "firms"."id" ASC LIMIT 1000
334
+  (0.5ms) ALTER TABLE "firms" DROP "latitude"
335
+  (0.4ms) ALTER TABLE "firms" DROP "longitude"
336
+ SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20151111132037"]]
337
+  (5.7ms) COMMIT
338
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
339
+  (2.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
340
+ FROM pg_constraint c
341
+ JOIN pg_class t1 ON c.conrelid = t1.oid
342
+ JOIN pg_class t2 ON c.confrelid = t2.oid
343
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
344
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
345
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
346
+ WHERE c.contype = 'f'
347
+ AND t1.relname = 'accreditations'
348
+ AND t3.nspname = ANY (current_schemas(false))
349
+ ORDER BY c.conname
350
+
351
+  (2.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
352
+ FROM pg_constraint c
353
+ JOIN pg_class t1 ON c.conrelid = t1.oid
354
+ JOIN pg_class t2 ON c.confrelid = t2.oid
355
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
356
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
357
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
358
+ WHERE c.contype = 'f'
359
+ AND t1.relname = 'accreditations_advisers'
360
+ AND t3.nspname = ANY (current_schemas(false))
361
+ ORDER BY c.conname
362
+ 
363
+  (2.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
364
+ FROM pg_constraint c
365
+ JOIN pg_class t1 ON c.conrelid = t1.oid
366
+ JOIN pg_class t2 ON c.confrelid = t2.oid
367
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
368
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
369
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
370
+ WHERE c.contype = 'f'
371
+ AND t1.relname = 'advisers'
372
+ AND t3.nspname = ANY (current_schemas(false))
373
+ ORDER BY c.conname
374
+
375
+  (2.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
376
+ FROM pg_constraint c
377
+ JOIN pg_class t1 ON c.conrelid = t1.oid
378
+ JOIN pg_class t2 ON c.confrelid = t2.oid
379
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
380
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
381
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
382
+ WHERE c.contype = 'f'
383
+ AND t1.relname = 'advisers_professional_bodies'
384
+ AND t3.nspname = ANY (current_schemas(false))
385
+ ORDER BY c.conname
386
+ 
387
+  (1.7ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
388
+ FROM pg_constraint c
389
+ JOIN pg_class t1 ON c.conrelid = t1.oid
390
+ JOIN pg_class t2 ON c.confrelid = t2.oid
391
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
392
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
393
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
394
+ WHERE c.contype = 'f'
395
+ AND t1.relname = 'advisers_professional_standings'
396
+ AND t3.nspname = ANY (current_schemas(false))
397
+ ORDER BY c.conname
398
+
399
+  (1.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
400
+ FROM pg_constraint c
401
+ JOIN pg_class t1 ON c.conrelid = t1.oid
402
+ JOIN pg_class t2 ON c.confrelid = t2.oid
403
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
404
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
405
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
406
+ WHERE c.contype = 'f'
407
+ AND t1.relname = 'advisers_qualifications'
408
+ AND t3.nspname = ANY (current_schemas(false))
409
+ ORDER BY c.conname
410
+ 
411
+  (1.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
412
+ FROM pg_constraint c
413
+ JOIN pg_class t1 ON c.conrelid = t1.oid
414
+ JOIN pg_class t2 ON c.confrelid = t2.oid
415
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
416
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
417
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
418
+ WHERE c.contype = 'f'
419
+ AND t1.relname = 'allowed_payment_methods'
420
+ AND t3.nspname = ANY (current_schemas(false))
421
+ ORDER BY c.conname
422
+
423
+  (1.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
424
+ FROM pg_constraint c
425
+ JOIN pg_class t1 ON c.conrelid = t1.oid
426
+ JOIN pg_class t2 ON c.confrelid = t2.oid
427
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
428
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
429
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
430
+ WHERE c.contype = 'f'
431
+ AND t1.relname = 'allowed_payment_methods_firms'
432
+ AND t3.nspname = ANY (current_schemas(false))
433
+ ORDER BY c.conname
434
+ 
435
+  (1.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
436
+ FROM pg_constraint c
437
+ JOIN pg_class t1 ON c.conrelid = t1.oid
438
+ JOIN pg_class t2 ON c.confrelid = t2.oid
439
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
440
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
441
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
442
+ WHERE c.contype = 'f'
443
+ AND t1.relname = 'firms'
444
+ AND t3.nspname = ANY (current_schemas(false))
445
+ ORDER BY c.conname
446
+
447
+  (1.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
448
+ FROM pg_constraint c
449
+ JOIN pg_class t1 ON c.conrelid = t1.oid
450
+ JOIN pg_class t2 ON c.confrelid = t2.oid
451
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
452
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
453
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
454
+ WHERE c.contype = 'f'
455
+ AND t1.relname = 'firms_in_person_advice_methods'
456
+ AND t3.nspname = ANY (current_schemas(false))
457
+ ORDER BY c.conname
458
+ 
459
+  (2.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
460
+ FROM pg_constraint c
461
+ JOIN pg_class t1 ON c.conrelid = t1.oid
462
+ JOIN pg_class t2 ON c.confrelid = t2.oid
463
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
464
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
465
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
466
+ WHERE c.contype = 'f'
467
+ AND t1.relname = 'firms_initial_advice_fee_structures'
468
+ AND t3.nspname = ANY (current_schemas(false))
469
+ ORDER BY c.conname
470
+
471
+  (2.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
472
+ FROM pg_constraint c
473
+ JOIN pg_class t1 ON c.conrelid = t1.oid
474
+ JOIN pg_class t2 ON c.confrelid = t2.oid
475
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
476
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
477
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
478
+ WHERE c.contype = 'f'
479
+ AND t1.relname = 'firms_investment_sizes'
480
+ AND t3.nspname = ANY (current_schemas(false))
481
+ ORDER BY c.conname
482
+ 
483
+  (1.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
484
+ FROM pg_constraint c
485
+ JOIN pg_class t1 ON c.conrelid = t1.oid
486
+ JOIN pg_class t2 ON c.confrelid = t2.oid
487
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
488
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
489
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
490
+ WHERE c.contype = 'f'
491
+ AND t1.relname = 'firms_ongoing_advice_fee_structures'
492
+ AND t3.nspname = ANY (current_schemas(false))
493
+ ORDER BY c.conname
494
+
495
+  (1.7ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
496
+ FROM pg_constraint c
497
+ JOIN pg_class t1 ON c.conrelid = t1.oid
498
+ JOIN pg_class t2 ON c.confrelid = t2.oid
499
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
500
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
501
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
502
+ WHERE c.contype = 'f'
503
+ AND t1.relname = 'firms_other_advice_methods'
504
+ AND t3.nspname = ANY (current_schemas(false))
505
+ ORDER BY c.conname
506
+ 
507
+  (2.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
508
+ FROM pg_constraint c
509
+ JOIN pg_class t1 ON c.conrelid = t1.oid
510
+ JOIN pg_class t2 ON c.confrelid = t2.oid
511
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
512
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
513
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
514
+ WHERE c.contype = 'f'
515
+ AND t1.relname = 'in_person_advice_methods'
516
+ AND t3.nspname = ANY (current_schemas(false))
517
+ ORDER BY c.conname
518
+
519
+  (1.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
520
+ FROM pg_constraint c
521
+ JOIN pg_class t1 ON c.conrelid = t1.oid
522
+ JOIN pg_class t2 ON c.confrelid = t2.oid
523
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
524
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
525
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
526
+ WHERE c.contype = 'f'
527
+ AND t1.relname = 'initial_advice_fee_structures'
528
+ AND t3.nspname = ANY (current_schemas(false))
529
+ ORDER BY c.conname
530
+ 
531
+  (1.7ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
532
+ FROM pg_constraint c
533
+ JOIN pg_class t1 ON c.conrelid = t1.oid
534
+ JOIN pg_class t2 ON c.confrelid = t2.oid
535
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
536
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
537
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
538
+ WHERE c.contype = 'f'
539
+ AND t1.relname = 'initial_meeting_durations'
540
+ AND t3.nspname = ANY (current_schemas(false))
541
+ ORDER BY c.conname
542
+
543
+  (1.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
544
+ FROM pg_constraint c
545
+ JOIN pg_class t1 ON c.conrelid = t1.oid
546
+ JOIN pg_class t2 ON c.confrelid = t2.oid
547
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
548
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
549
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
550
+ WHERE c.contype = 'f'
551
+ AND t1.relname = 'investment_sizes'
552
+ AND t3.nspname = ANY (current_schemas(false))
553
+ ORDER BY c.conname
554
+ 
555
+  (2.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
556
+ FROM pg_constraint c
557
+ JOIN pg_class t1 ON c.conrelid = t1.oid
558
+ JOIN pg_class t2 ON c.confrelid = t2.oid
559
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
560
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
561
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
562
+ WHERE c.contype = 'f'
563
+ AND t1.relname = 'lookup_advisers'
564
+ AND t3.nspname = ANY (current_schemas(false))
565
+ ORDER BY c.conname
566
+
567
+  (1.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
568
+ FROM pg_constraint c
569
+ JOIN pg_class t1 ON c.conrelid = t1.oid
570
+ JOIN pg_class t2 ON c.confrelid = t2.oid
571
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
572
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
573
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
574
+ WHERE c.contype = 'f'
575
+ AND t1.relname = 'lookup_firms'
576
+ AND t3.nspname = ANY (current_schemas(false))
577
+ ORDER BY c.conname
578
+ 
579
+  (2.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
580
+ FROM pg_constraint c
581
+ JOIN pg_class t1 ON c.conrelid = t1.oid
582
+ JOIN pg_class t2 ON c.confrelid = t2.oid
583
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
584
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
585
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
586
+ WHERE c.contype = 'f'
587
+ AND t1.relname = 'lookup_subsidiaries'
588
+ AND t3.nspname = ANY (current_schemas(false))
589
+ ORDER BY c.conname
590
+
591
+  (1.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
592
+ FROM pg_constraint c
593
+ JOIN pg_class t1 ON c.conrelid = t1.oid
594
+ JOIN pg_class t2 ON c.confrelid = t2.oid
595
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
596
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
597
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
598
+ WHERE c.contype = 'f'
599
+ AND t1.relname = 'offices'
600
+ AND t3.nspname = ANY (current_schemas(false))
601
+ ORDER BY c.conname
602
+ 
603
+  (1.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
604
+ FROM pg_constraint c
605
+ JOIN pg_class t1 ON c.conrelid = t1.oid
606
+ JOIN pg_class t2 ON c.confrelid = t2.oid
607
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
608
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
609
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
610
+ WHERE c.contype = 'f'
611
+ AND t1.relname = 'ongoing_advice_fee_structures'
612
+ AND t3.nspname = ANY (current_schemas(false))
613
+ ORDER BY c.conname
614
+
615
+  (1.7ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
616
+ FROM pg_constraint c
617
+ JOIN pg_class t1 ON c.conrelid = t1.oid
618
+ JOIN pg_class t2 ON c.confrelid = t2.oid
619
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
620
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
621
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
622
+ WHERE c.contype = 'f'
623
+ AND t1.relname = 'other_advice_methods'
624
+ AND t3.nspname = ANY (current_schemas(false))
625
+ ORDER BY c.conname
626
+ 
627
+  (1.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
628
+ FROM pg_constraint c
629
+ JOIN pg_class t1 ON c.conrelid = t1.oid
630
+ JOIN pg_class t2 ON c.confrelid = t2.oid
631
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
632
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
633
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
634
+ WHERE c.contype = 'f'
635
+ AND t1.relname = 'principals'
636
+ AND t3.nspname = ANY (current_schemas(false))
637
+ ORDER BY c.conname
638
+
639
+  (1.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
640
+ FROM pg_constraint c
641
+ JOIN pg_class t1 ON c.conrelid = t1.oid
642
+ JOIN pg_class t2 ON c.confrelid = t2.oid
643
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
644
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
645
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
646
+ WHERE c.contype = 'f'
647
+ AND t1.relname = 'professional_bodies'
648
+ AND t3.nspname = ANY (current_schemas(false))
649
+ ORDER BY c.conname
650
+ 
651
+  (2.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
652
+ FROM pg_constraint c
653
+ JOIN pg_class t1 ON c.conrelid = t1.oid
654
+ JOIN pg_class t2 ON c.confrelid = t2.oid
655
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
656
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
657
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
658
+ WHERE c.contype = 'f'
659
+ AND t1.relname = 'professional_standings'
660
+ AND t3.nspname = ANY (current_schemas(false))
661
+ ORDER BY c.conname
662
+
663
+  (2.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
664
+ FROM pg_constraint c
665
+ JOIN pg_class t1 ON c.conrelid = t1.oid
666
+ JOIN pg_class t2 ON c.confrelid = t2.oid
667
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
668
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
669
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
670
+ WHERE c.contype = 'f'
671
+ AND t1.relname = 'qualifications'
672
+ AND t3.nspname = ANY (current_schemas(false))
673
+ ORDER BY c.conname
674
+ 
675
+ ActiveRecord::SchemaMigration Load (2.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
676
+ Migrating to AddBypassReferenceNumberCheckToAdvisers (20160205150033)
677
+  (0.2ms) BEGIN
678
+  (29.1ms) ALTER TABLE "advisers" ADD "bypass_reference_number_check" boolean DEFAULT 'f'
679
+ SQL (0.6ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160205150033"]]
680
+  (1.4ms) COMMIT
681
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
682
+  (2.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
683
+ FROM pg_constraint c
684
+ JOIN pg_class t1 ON c.conrelid = t1.oid
685
+ JOIN pg_class t2 ON c.confrelid = t2.oid
686
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
687
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
688
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
689
+ WHERE c.contype = 'f'
690
+ AND t1.relname = 'accreditations'
691
+ AND t3.nspname = ANY (current_schemas(false))
692
+ ORDER BY c.conname
693
+ 
694
+  (1.7ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
695
+ FROM pg_constraint c
696
+ JOIN pg_class t1 ON c.conrelid = t1.oid
697
+ JOIN pg_class t2 ON c.confrelid = t2.oid
698
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
699
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
700
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
701
+ WHERE c.contype = 'f'
702
+ AND t1.relname = 'accreditations_advisers'
703
+ AND t3.nspname = ANY (current_schemas(false))
704
+ ORDER BY c.conname
705
+
706
+  (1.7ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
707
+ FROM pg_constraint c
708
+ JOIN pg_class t1 ON c.conrelid = t1.oid
709
+ JOIN pg_class t2 ON c.confrelid = t2.oid
710
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
711
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
712
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
713
+ WHERE c.contype = 'f'
714
+ AND t1.relname = 'advisers'
715
+ AND t3.nspname = ANY (current_schemas(false))
716
+ ORDER BY c.conname
717
+ 
718
+  (1.7ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
719
+ FROM pg_constraint c
720
+ JOIN pg_class t1 ON c.conrelid = t1.oid
721
+ JOIN pg_class t2 ON c.confrelid = t2.oid
722
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
723
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
724
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
725
+ WHERE c.contype = 'f'
726
+ AND t1.relname = 'advisers_professional_bodies'
727
+ AND t3.nspname = ANY (current_schemas(false))
728
+ ORDER BY c.conname
729
+
730
+  (1.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
731
+ FROM pg_constraint c
732
+ JOIN pg_class t1 ON c.conrelid = t1.oid
733
+ JOIN pg_class t2 ON c.confrelid = t2.oid
734
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
735
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
736
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
737
+ WHERE c.contype = 'f'
738
+ AND t1.relname = 'advisers_professional_standings'
739
+ AND t3.nspname = ANY (current_schemas(false))
740
+ ORDER BY c.conname
741
+ 
742
+  (1.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
743
+ FROM pg_constraint c
744
+ JOIN pg_class t1 ON c.conrelid = t1.oid
745
+ JOIN pg_class t2 ON c.confrelid = t2.oid
746
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
747
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
748
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
749
+ WHERE c.contype = 'f'
750
+ AND t1.relname = 'advisers_qualifications'
751
+ AND t3.nspname = ANY (current_schemas(false))
752
+ ORDER BY c.conname
753
+
754
+  (1.7ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
755
+ FROM pg_constraint c
756
+ JOIN pg_class t1 ON c.conrelid = t1.oid
757
+ JOIN pg_class t2 ON c.confrelid = t2.oid
758
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
759
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
760
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
761
+ WHERE c.contype = 'f'
762
+ AND t1.relname = 'allowed_payment_methods'
763
+ AND t3.nspname = ANY (current_schemas(false))
764
+ ORDER BY c.conname
765
+ 
766
+  (1.7ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
767
+ FROM pg_constraint c
768
+ JOIN pg_class t1 ON c.conrelid = t1.oid
769
+ JOIN pg_class t2 ON c.confrelid = t2.oid
770
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
771
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
772
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
773
+ WHERE c.contype = 'f'
774
+ AND t1.relname = 'allowed_payment_methods_firms'
775
+ AND t3.nspname = ANY (current_schemas(false))
776
+ ORDER BY c.conname
777
+
778
+  (1.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
779
+ FROM pg_constraint c
780
+ JOIN pg_class t1 ON c.conrelid = t1.oid
781
+ JOIN pg_class t2 ON c.confrelid = t2.oid
782
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
783
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
784
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
785
+ WHERE c.contype = 'f'
786
+ AND t1.relname = 'firms'
787
+ AND t3.nspname = ANY (current_schemas(false))
788
+ ORDER BY c.conname
789
+ 
790
+  (1.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
791
+ FROM pg_constraint c
792
+ JOIN pg_class t1 ON c.conrelid = t1.oid
793
+ JOIN pg_class t2 ON c.confrelid = t2.oid
794
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
795
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
796
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
797
+ WHERE c.contype = 'f'
798
+ AND t1.relname = 'firms_in_person_advice_methods'
799
+ AND t3.nspname = ANY (current_schemas(false))
800
+ ORDER BY c.conname
801
+
802
+  (1.7ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
803
+ FROM pg_constraint c
804
+ JOIN pg_class t1 ON c.conrelid = t1.oid
805
+ JOIN pg_class t2 ON c.confrelid = t2.oid
806
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
807
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
808
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
809
+ WHERE c.contype = 'f'
810
+ AND t1.relname = 'firms_initial_advice_fee_structures'
811
+ AND t3.nspname = ANY (current_schemas(false))
812
+ ORDER BY c.conname
813
+ 
814
+  (7.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
815
+ FROM pg_constraint c
816
+ JOIN pg_class t1 ON c.conrelid = t1.oid
817
+ JOIN pg_class t2 ON c.confrelid = t2.oid
818
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
819
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
820
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
821
+ WHERE c.contype = 'f'
822
+ AND t1.relname = 'firms_investment_sizes'
823
+ AND t3.nspname = ANY (current_schemas(false))
824
+ ORDER BY c.conname
825
+
826
+  (4.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
827
+ FROM pg_constraint c
828
+ JOIN pg_class t1 ON c.conrelid = t1.oid
829
+ JOIN pg_class t2 ON c.confrelid = t2.oid
830
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
831
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
832
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
833
+ WHERE c.contype = 'f'
834
+ AND t1.relname = 'firms_ongoing_advice_fee_structures'
835
+ AND t3.nspname = ANY (current_schemas(false))
836
+ ORDER BY c.conname
837
+ 
838
+  (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
839
+ FROM pg_constraint c
840
+ JOIN pg_class t1 ON c.conrelid = t1.oid
841
+ JOIN pg_class t2 ON c.confrelid = t2.oid
842
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
843
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
844
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
845
+ WHERE c.contype = 'f'
846
+ AND t1.relname = 'firms_other_advice_methods'
847
+ AND t3.nspname = ANY (current_schemas(false))
848
+ ORDER BY c.conname
849
+
850
+  (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
851
+ FROM pg_constraint c
852
+ JOIN pg_class t1 ON c.conrelid = t1.oid
853
+ JOIN pg_class t2 ON c.confrelid = t2.oid
854
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
855
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
856
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
857
+ WHERE c.contype = 'f'
858
+ AND t1.relname = 'in_person_advice_methods'
859
+ AND t3.nspname = ANY (current_schemas(false))
860
+ ORDER BY c.conname
861
+ 
862
+  (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
863
+ FROM pg_constraint c
864
+ JOIN pg_class t1 ON c.conrelid = t1.oid
865
+ JOIN pg_class t2 ON c.confrelid = t2.oid
866
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
867
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
868
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
869
+ WHERE c.contype = 'f'
870
+ AND t1.relname = 'initial_advice_fee_structures'
871
+ AND t3.nspname = ANY (current_schemas(false))
872
+ ORDER BY c.conname
873
+
874
+  (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
875
+ FROM pg_constraint c
876
+ JOIN pg_class t1 ON c.conrelid = t1.oid
877
+ JOIN pg_class t2 ON c.confrelid = t2.oid
878
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
879
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
880
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
881
+ WHERE c.contype = 'f'
882
+ AND t1.relname = 'initial_meeting_durations'
883
+ AND t3.nspname = ANY (current_schemas(false))
884
+ ORDER BY c.conname
885
+ 
886
+  (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
887
+ FROM pg_constraint c
888
+ JOIN pg_class t1 ON c.conrelid = t1.oid
889
+ JOIN pg_class t2 ON c.confrelid = t2.oid
890
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
891
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
892
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
893
+ WHERE c.contype = 'f'
894
+ AND t1.relname = 'investment_sizes'
895
+ AND t3.nspname = ANY (current_schemas(false))
896
+ ORDER BY c.conname
897
+
898
+  (3.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
899
+ FROM pg_constraint c
900
+ JOIN pg_class t1 ON c.conrelid = t1.oid
901
+ JOIN pg_class t2 ON c.confrelid = t2.oid
902
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
903
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
904
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
905
+ WHERE c.contype = 'f'
906
+ AND t1.relname = 'lookup_advisers'
907
+ AND t3.nspname = ANY (current_schemas(false))
908
+ ORDER BY c.conname
909
+ 
910
+  (5.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
911
+ FROM pg_constraint c
912
+ JOIN pg_class t1 ON c.conrelid = t1.oid
913
+ JOIN pg_class t2 ON c.confrelid = t2.oid
914
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
915
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
916
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
917
+ WHERE c.contype = 'f'
918
+ AND t1.relname = 'lookup_firms'
919
+ AND t3.nspname = ANY (current_schemas(false))
920
+ ORDER BY c.conname
921
+
922
+  (4.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
923
+ FROM pg_constraint c
924
+ JOIN pg_class t1 ON c.conrelid = t1.oid
925
+ JOIN pg_class t2 ON c.confrelid = t2.oid
926
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
927
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
928
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
929
+ WHERE c.contype = 'f'
930
+ AND t1.relname = 'lookup_subsidiaries'
931
+ AND t3.nspname = ANY (current_schemas(false))
932
+ ORDER BY c.conname
933
+ 
934
+  (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
935
+ FROM pg_constraint c
936
+ JOIN pg_class t1 ON c.conrelid = t1.oid
937
+ JOIN pg_class t2 ON c.confrelid = t2.oid
938
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
939
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
940
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
941
+ WHERE c.contype = 'f'
942
+ AND t1.relname = 'offices'
943
+ AND t3.nspname = ANY (current_schemas(false))
944
+ ORDER BY c.conname
945
+
946
+  (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
947
+ FROM pg_constraint c
948
+ JOIN pg_class t1 ON c.conrelid = t1.oid
949
+ JOIN pg_class t2 ON c.confrelid = t2.oid
950
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
951
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
952
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
953
+ WHERE c.contype = 'f'
954
+ AND t1.relname = 'ongoing_advice_fee_structures'
955
+ AND t3.nspname = ANY (current_schemas(false))
956
+ ORDER BY c.conname
957
+ 
958
+  (2.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
959
+ FROM pg_constraint c
960
+ JOIN pg_class t1 ON c.conrelid = t1.oid
961
+ JOIN pg_class t2 ON c.confrelid = t2.oid
962
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
963
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
964
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
965
+ WHERE c.contype = 'f'
966
+ AND t1.relname = 'other_advice_methods'
967
+ AND t3.nspname = ANY (current_schemas(false))
968
+ ORDER BY c.conname
969
+
970
+  (2.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
971
+ FROM pg_constraint c
972
+ JOIN pg_class t1 ON c.conrelid = t1.oid
973
+ JOIN pg_class t2 ON c.confrelid = t2.oid
974
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
975
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
976
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
977
+ WHERE c.contype = 'f'
978
+ AND t1.relname = 'principals'
979
+ AND t3.nspname = ANY (current_schemas(false))
980
+ ORDER BY c.conname
981
+ 
982
+  (1.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
983
+ FROM pg_constraint c
984
+ JOIN pg_class t1 ON c.conrelid = t1.oid
985
+ JOIN pg_class t2 ON c.confrelid = t2.oid
986
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
987
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
988
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
989
+ WHERE c.contype = 'f'
990
+ AND t1.relname = 'professional_bodies'
991
+ AND t3.nspname = ANY (current_schemas(false))
992
+ ORDER BY c.conname
993
+
994
+  (3.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
995
+ FROM pg_constraint c
996
+ JOIN pg_class t1 ON c.conrelid = t1.oid
997
+ JOIN pg_class t2 ON c.confrelid = t2.oid
998
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
999
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1000
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1001
+ WHERE c.contype = 'f'
1002
+ AND t1.relname = 'professional_standings'
1003
+ AND t3.nspname = ANY (current_schemas(false))
1004
+ ORDER BY c.conname
1005
+ 
1006
+  (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
1007
+ FROM pg_constraint c
1008
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1009
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1010
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1011
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1012
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1013
+ WHERE c.contype = 'f'
1014
+ AND t1.relname = 'qualifications'
1015
+ AND t3.nspname = ANY (current_schemas(false))
1016
+ ORDER BY c.conname
1017
+
1018
+  (124.7ms) DROP DATABASE IF EXISTS "rad_core_test"
1019
+  (348.9ms) CREATE DATABASE "rad_core_test" ENCODING = 'utf8'
1020
+ SQL (0.4ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
1021
+  (4.4ms) 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)
1022
+  (0.9ms) CREATE TABLE "accreditations_advisers" ("adviser_id" integer NOT NULL, "accreditation_id" integer NOT NULL) 
1023
+  (1.1ms) CREATE UNIQUE INDEX "advisers_accreditations_index" ON "accreditations_advisers" USING btree ("adviser_id", "accreditation_id")
1024
+  (3.4ms) 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, "bypass_reference_number_check" boolean DEFAULT 'f') 
1025
+  (0.9ms) CREATE TABLE "advisers_professional_bodies" ("adviser_id" integer NOT NULL, "professional_body_id" integer NOT NULL)
1026
+  (1.1ms) CREATE UNIQUE INDEX "advisers_professional_bodies_index" ON "advisers_professional_bodies" USING btree ("adviser_id", "professional_body_id")
1027
+  (0.9ms) CREATE TABLE "advisers_professional_standings" ("adviser_id" integer NOT NULL, "professional_standing_id" integer NOT NULL)
1028
+  (1.2ms) CREATE UNIQUE INDEX "advisers_professional_standings_index" ON "advisers_professional_standings" USING btree ("adviser_id", "professional_standing_id")
1029
+  (0.9ms) CREATE TABLE "advisers_qualifications" ("adviser_id" integer NOT NULL, "qualification_id" integer NOT NULL)
1030
+  (1.1ms) CREATE UNIQUE INDEX "advisers_qualifications_index" ON "advisers_qualifications" USING btree ("adviser_id", "qualification_id")
1031
+  (2.9ms) 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)
1032
+  (0.8ms) CREATE TABLE "allowed_payment_methods_firms" ("firm_id" integer NOT NULL, "allowed_payment_method_id" integer NOT NULL) 
1033
+  (1.1ms) CREATE UNIQUE INDEX "firms_allowed_payment_methods_index" ON "allowed_payment_methods_firms" USING btree ("firm_id", "allowed_payment_method_id")
1034
+  (3.9ms) CREATE TABLE "firms" ("id" serial primary key, "fca_number" integer NOT NULL, "registered_name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "free_initial_meeting" boolean, "initial_meeting_duration_id" integer, "minimum_fixed_fee" integer DEFAULT 0, "parent_id" integer, "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, "languages" text[] DEFAULT '{}' NOT NULL, "status" integer) 
1035
+  (1.1ms) CREATE INDEX "index_firms_on_initial_meeting_duration_id" ON "firms" USING btree ("initial_meeting_duration_id")
1036
+  (0.8ms) CREATE TABLE "firms_in_person_advice_methods" ("firm_id" integer NOT NULL, "in_person_advice_method_id" integer NOT NULL) 
1037
+  (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")
1038
+  (0.8ms) CREATE TABLE "firms_initial_advice_fee_structures" ("firm_id" integer NOT NULL, "initial_advice_fee_structure_id" integer NOT NULL) 
1039
+  (1.1ms) CREATE UNIQUE INDEX "firms_initial_advice_fee_structures_index" ON "firms_initial_advice_fee_structures" USING btree ("firm_id", "initial_advice_fee_structure_id")
1040
+  (1.0ms) CREATE TABLE "firms_investment_sizes" ("firm_id" integer NOT NULL, "investment_size_id" integer NOT NULL) 
1041
+  (1.1ms) CREATE UNIQUE INDEX "firms_investment_sizes_index" ON "firms_investment_sizes" USING btree ("firm_id", "investment_size_id")
1042
+  (0.9ms) CREATE TABLE "firms_ongoing_advice_fee_structures" ("firm_id" integer NOT NULL, "ongoing_advice_fee_structure_id" integer NOT NULL) 
1043
+  (1.2ms) CREATE UNIQUE INDEX "firms_ongoing_advice_fee_structures_index" ON "firms_ongoing_advice_fee_structures" USING btree ("firm_id", "ongoing_advice_fee_structure_id")
1044
+  (0.9ms) CREATE TABLE "firms_other_advice_methods" ("firm_id" integer NOT NULL, "other_advice_method_id" integer NOT NULL) 
1045
+  (1.2ms) CREATE UNIQUE INDEX "firms_other_advice_methods_index" ON "firms_other_advice_methods" USING btree ("firm_id", "other_advice_method_id")
1046
+  (2.9ms) 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) 
1047
+  (3.2ms) 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)
1048
+  (3.0ms) 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) 
1049
+  (3.9ms) 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)
1050
+  (3.1ms) 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) 
1051
+  (1.3ms) CREATE UNIQUE INDEX "index_lookup_advisers_on_reference_number" ON "lookup_advisers" USING btree ("reference_number")
1052
+  (3.5ms) 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) 
1053
+  (1.0ms) CREATE UNIQUE INDEX "index_lookup_firms_on_fca_number" ON "lookup_firms" USING btree ("fca_number")
1054
+  (2.7ms) 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) 
1055
+  (1.2ms) CREATE INDEX "index_lookup_subsidiaries_on_fca_number" ON "lookup_subsidiaries" USING btree ("fca_number")
1056
+  (3.0ms) CREATE TABLE "offices" ("id" serial primary key, "address_line_one" character varying NOT NULL, "address_line_two" character varying, "address_town" character varying NOT NULL, "address_county" character varying, "address_postcode" character varying NOT NULL, "email_address" character varying, "telephone_number" character varying, "disabled_access" boolean DEFAULT 'f' NOT NULL, "firm_id" integer NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "latitude" float, "longitude" float) 
1057
+  (2.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)
1058
+  (3.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) 
1059
+  (3.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)
1060
+  (1.1ms) CREATE UNIQUE INDEX "index_principals_on_fca_number" ON "principals" USING btree ("fca_number")
1061
+  (1.1ms) CREATE UNIQUE INDEX "index_principals_on_token" ON "principals" USING btree ("token")
1062
+  (2.9ms) 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) 
1063
+  (3.1ms) 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)
1064
+  (2.5ms) 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) 
1065
+  (1.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL)
1066
+  (1.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1067
+  (0.4ms) SELECT version FROM "schema_migrations"
1068
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20160205150033')
1069
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20141211110031')
1070
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20141221140208')
1071
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20141222150416')
1072
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20141230112136')
1073
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150106115732')
1074
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150114144343')
1075
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150114151447')
1076
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150115130949')
1077
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150119102735')
1078
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150119111754')
1079
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150119114218')
1080
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150119125208')
1081
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150119152325')
1082
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150119152336')
1083
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150120133717')
1084
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150120141928')
1085
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150120150738')
1086
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150121110757')
1087
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150121123437')
1088
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150121134845')
1089
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150121154458')
1090
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150121173015')
1091
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150121181341')
1092
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150121183728')
1093
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150124124350')
1094
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150125145457')
1095
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150125164156')
1096
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150127084858')
1097
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150209144836')
1098
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150210113610')
1099
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150222092417')
1100
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150228095315')
1101
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150305150719')
1102
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150423154732')
1103
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150630143001')
1104
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20150706102943')
1105
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150716123032')
1106
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150806143047')
1107
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150807134551')
1108
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150812140642')
1109
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150813103046')
1110
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150817141257')
1111
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150825090822')
1112
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150930140851')
1113
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20151102113518')
1114
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20151103161642')
1115
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20151111132037')
1116
+  (0.2ms) BEGIN
1117
+ Adviser Exists (7.1ms) SELECT 1 AS one FROM "advisers" WHERE "advisers"."reference_number" IS NULL LIMIT 1
1118
+ Lookup::Adviser Exists (24.7ms) SELECT 1 AS one FROM "lookup_advisers" WHERE "lookup_advisers"."reference_number" IS NULL LIMIT 1
1119
+  (0.2ms) ROLLBACK
1120
+ Adviser Exists (0.4ms) SELECT 1 AS one FROM "advisers" WHERE "advisers"."reference_number" IS NULL LIMIT 1
1121
+ Lookup::Adviser Exists (0.4ms) SELECT 1 AS one FROM "lookup_advisers" WHERE "lookup_advisers"."reference_number" IS NULL LIMIT 1