active_record_doctor 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +7 -0
  2. data/README.rdoc +48 -0
  3. data/Rakefile +28 -0
  4. data/lib/active_record_doctor.rb +4 -0
  5. data/lib/active_record_doctor/printers.rb +4 -0
  6. data/lib/active_record_doctor/printers/io_printer.rb +15 -0
  7. data/lib/active_record_doctor/railtie.rb +7 -0
  8. data/lib/active_record_doctor/tasks.rb +4 -0
  9. data/lib/active_record_doctor/tasks/unindexed_foreign_keys.rb +50 -0
  10. data/lib/active_record_doctor/version.rb +3 -0
  11. data/lib/generators/active_record_doctor/add_indexes/USAGE +2 -0
  12. data/lib/generators/active_record_doctor/add_indexes/add_indexes_generator.rb +48 -0
  13. data/lib/tasks/active_record_doctor_tasks.rake +7 -0
  14. data/test/active_record_doctor/printers/io_printer_test.rb +20 -0
  15. data/test/active_record_doctor/tasks/unindexed_foreign_keys_test.rb +19 -0
  16. data/test/dummy/README.rdoc +28 -0
  17. data/test/dummy/Rakefile +6 -0
  18. data/test/dummy/app/assets/javascripts/application.js +13 -0
  19. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  20. data/test/dummy/app/controllers/application_controller.rb +5 -0
  21. data/test/dummy/app/helpers/application_helper.rb +2 -0
  22. data/test/dummy/app/models/employer.rb +2 -0
  23. data/test/dummy/app/models/profile.rb +2 -0
  24. data/test/dummy/app/models/user.rb +3 -0
  25. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  26. data/test/dummy/bin/bundle +3 -0
  27. data/test/dummy/bin/rails +4 -0
  28. data/test/dummy/bin/rake +4 -0
  29. data/test/dummy/bin/setup +29 -0
  30. data/test/dummy/config.ru +4 -0
  31. data/test/dummy/config/application.rb +26 -0
  32. data/test/dummy/config/boot.rb +5 -0
  33. data/test/dummy/config/database.yml +25 -0
  34. data/test/dummy/config/environment.rb +5 -0
  35. data/test/dummy/config/environments/development.rb +41 -0
  36. data/test/dummy/config/environments/production.rb +79 -0
  37. data/test/dummy/config/environments/test.rb +42 -0
  38. data/test/dummy/config/initializers/assets.rb +11 -0
  39. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  40. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  41. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  42. data/test/dummy/config/initializers/inflections.rb +16 -0
  43. data/test/dummy/config/initializers/mime_types.rb +4 -0
  44. data/test/dummy/config/initializers/session_store.rb +3 -0
  45. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  46. data/test/dummy/config/locales/en.yml +23 -0
  47. data/test/dummy/config/routes.rb +56 -0
  48. data/test/dummy/config/secrets.yml +22 -0
  49. data/test/dummy/db/development.sqlite3 +0 -0
  50. data/test/dummy/db/migrate/20160213101213_create_users.rb +14 -0
  51. data/test/dummy/db/migrate/20160213101232_create_profiles.rb +10 -0
  52. data/test/dummy/db/migrate/20160213102131_create_employers.rb +9 -0
  53. data/test/dummy/db/schema.rb +41 -0
  54. data/test/dummy/db/test.sqlite3 +0 -0
  55. data/test/dummy/log/development.log +654 -0
  56. data/test/dummy/log/test.log +10337 -0
  57. data/test/dummy/public/404.html +67 -0
  58. data/test/dummy/public/422.html +67 -0
  59. data/test/dummy/public/500.html +66 -0
  60. data/test/dummy/public/favicon.ico +0 -0
  61. data/test/support/spy_printer.rb +11 -0
  62. data/test/test_helper.rb +20 -0
  63. metadata +182 -0
@@ -0,0 +1,9 @@
1
+ class CreateEmployers < ActiveRecord::Migration
2
+ def change
3
+ create_table :employers do |t|
4
+ t.string :name
5
+
6
+ t.timestamps null: false
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,41 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20160213102131) do
15
+
16
+ create_table "employers", force: :cascade do |t|
17
+ t.string "name"
18
+ t.datetime "created_at", null: false
19
+ t.datetime "updated_at", null: false
20
+ end
21
+
22
+ create_table "profiles", force: :cascade do |t|
23
+ t.string "first_name"
24
+ t.string "last_name"
25
+ t.datetime "created_at", null: false
26
+ t.datetime "updated_at", null: false
27
+ end
28
+
29
+ create_table "users", force: :cascade do |t|
30
+ t.string "email"
31
+ t.integer "profile_id"
32
+ t.integer "employer_id"
33
+ t.string "country_code", null: false
34
+ t.datetime "created_at", null: false
35
+ t.datetime "updated_at", null: false
36
+ end
37
+
38
+ add_index "users", ["email"], name: "index_users_on_email", unique: true
39
+ add_index "users", ["employer_id", "country_code"], name: "index_users_on_employer_id_and_country_code"
40
+
41
+ end
@@ -0,0 +1,654 @@
1
+  (33.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2
+  (0.0ms) select sqlite_version(*)
3
+  (26.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
+ ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
+ ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
6
+ Migrating to CreateUsers (20160213101213)
7
+  (0.0ms) begin transaction
8
+  (0.4ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar, "profile_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
9
+  (0.0ms) select sqlite_version(*)
10
+  (0.1ms) CREATE INDEX "index_users_on_profile_id" ON "users" ("profile_id")
11
+  (0.1ms) SELECT sql
12
+ FROM sqlite_master
13
+ WHERE name='index_users_on_profile_id' AND type='index'
14
+ UNION ALL
15
+ SELECT sql
16
+ FROM sqlite_temp_master
17
+ WHERE name='index_users_on_profile_id' AND type='index'
18
+
19
+  (0.2ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
20
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160213101213"]]
21
+  (30.1ms) commit transaction
22
+ Migrating to CreateProfiles (20160213101232)
23
+  (0.0ms) begin transaction
24
+  (0.2ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "first_name" varchar, "last_name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
25
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160213101232"]]
26
+  (24.8ms) commit transaction
27
+ ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
28
+  (0.1ms)  SELECT sql
29
+ FROM sqlite_master
30
+ WHERE name='index_users_on_email' AND type='index'
31
+ UNION ALL
32
+ SELECT sql
33
+ FROM sqlite_temp_master
34
+ WHERE name='index_users_on_email' AND type='index'
35
+ 
36
+  (0.0ms) SELECT sql
37
+ FROM sqlite_master
38
+ WHERE name='index_users_on_profile_id' AND type='index'
39
+ UNION ALL
40
+ SELECT sql
41
+ FROM sqlite_temp_master
42
+ WHERE name='index_users_on_profile_id' AND type='index'
43
+
44
+  (38.8ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
45
+  (0.0ms) select sqlite_version(*)
46
+  (33.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
47
+ ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
48
+ Migrating to CreateUsers (20160213101213)
49
+  (0.0ms) begin transaction
50
+  (0.2ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar, "profile_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
51
+  (0.1ms) CREATE INDEX "index_users_on_profile_id" ON "users" ("profile_id")
52
+  (0.1ms) SELECT sql
53
+ FROM sqlite_master
54
+ WHERE name='index_users_on_profile_id' AND type='index'
55
+ UNION ALL
56
+ SELECT sql
57
+ FROM sqlite_temp_master
58
+ WHERE name='index_users_on_profile_id' AND type='index'
59
+
60
+  (0.1ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
61
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160213101213"]]
62
+  (27.8ms) commit transaction
63
+ Migrating to CreateProfiles (20160213101232)
64
+  (0.0ms) begin transaction
65
+  (0.2ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "first_name" varchar, "last_name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
66
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160213101232"]]
67
+  (25.3ms) commit transaction
68
+ ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
69
+  (0.1ms)  SELECT sql
70
+ FROM sqlite_master
71
+ WHERE name='index_users_on_email' AND type='index'
72
+ UNION ALL
73
+ SELECT sql
74
+ FROM sqlite_temp_master
75
+ WHERE name='index_users_on_email' AND type='index'
76
+ 
77
+  (0.0ms) SELECT sql
78
+ FROM sqlite_master
79
+ WHERE name='index_users_on_profile_id' AND type='index'
80
+ UNION ALL
81
+ SELECT sql
82
+ FROM sqlite_temp_master
83
+ WHERE name='index_users_on_profile_id' AND type='index'
84
+
85
+  (33.1ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
86
+  (0.1ms) select sqlite_version(*)
87
+  (32.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
88
+ ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
89
+ Migrating to CreateUsers (20160213101213)
90
+  (0.0ms) begin transaction
91
+  (0.2ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar, "profile_id" integer, "employer_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
92
+  (0.1ms) CREATE INDEX "index_users_on_employer_id" ON "users" ("employer_id")
93
+  (0.1ms) SELECT sql
94
+ FROM sqlite_master
95
+ WHERE name='index_users_on_employer_id' AND type='index'
96
+ UNION ALL
97
+ SELECT sql
98
+ FROM sqlite_temp_master
99
+ WHERE name='index_users_on_employer_id' AND type='index'
100
+
101
+  (0.1ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
102
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160213101213"]]
103
+  (27.1ms) commit transaction
104
+ Migrating to CreateProfiles (20160213101232)
105
+  (0.1ms) begin transaction
106
+  (0.2ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "first_name" varchar, "last_name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
107
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160213101232"]]
108
+  (40.6ms) commit transaction
109
+ Migrating to CreateEmployers (20160213102131)
110
+  (0.0ms) begin transaction
111
+  (0.2ms) CREATE TABLE "employers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
112
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160213102131"]]
113
+  (16.0ms) commit transaction
114
+ ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
115
+  (0.1ms)  SELECT sql
116
+ FROM sqlite_master
117
+ WHERE name='index_users_on_email' AND type='index'
118
+ UNION ALL
119
+ SELECT sql
120
+ FROM sqlite_temp_master
121
+ WHERE name='index_users_on_email' AND type='index'
122
+ 
123
+  (0.0ms) SELECT sql
124
+ FROM sqlite_master
125
+ WHERE name='index_users_on_employer_id' AND type='index'
126
+ UNION ALL
127
+ SELECT sql
128
+ FROM sqlite_temp_master
129
+ WHERE name='index_users_on_employer_id' AND type='index'
130
+
131
+  (33.4ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
132
+  (0.0ms) select sqlite_version(*)
133
+  (35.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
134
+ ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
135
+ Migrating to CreateUsers (20160213101213)
136
+  (0.0ms) begin transaction
137
+  (0.2ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar, "profile_id" integer, "employer_id" integer, "country_code" varchar NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
138
+  (0.2ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
139
+  (0.1ms) SELECT sql
140
+ FROM sqlite_master
141
+ WHERE name='index_users_on_email' AND type='index'
142
+ UNION ALL
143
+ SELECT sql
144
+ FROM sqlite_temp_master
145
+ WHERE name='index_users_on_email' AND type='index'
146
+
147
+  (0.1ms) CREATE INDEX "index_users_on_employer_and_country_code" ON "users" ("employer", "country_code")
148
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160213101213"]]
149
+  (21.4ms) commit transaction
150
+ Migrating to CreateProfiles (20160213101232)
151
+  (0.0ms) begin transaction
152
+  (0.2ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "first_name" varchar, "last_name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
153
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160213101232"]]
154
+  (35.6ms) commit transaction
155
+ Migrating to CreateEmployers (20160213102131)
156
+  (0.0ms) begin transaction
157
+  (0.1ms) CREATE TABLE "employers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
158
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160213102131"]]
159
+  (29.8ms) commit transaction
160
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
161
+  (0.0ms)  SELECT sql
162
+ FROM sqlite_master
163
+ WHERE name='index_users_on_employer_and_country_code' AND type='index'
164
+ UNION ALL
165
+ SELECT sql
166
+ FROM sqlite_temp_master
167
+ WHERE name='index_users_on_employer_and_country_code' AND type='index'
168
+ 
169
+  (0.0ms) SELECT sql
170
+ FROM sqlite_master
171
+ WHERE name='index_users_on_email' AND type='index'
172
+ UNION ALL
173
+ SELECT sql
174
+ FROM sqlite_temp_master
175
+ WHERE name='index_users_on_email' AND type='index'
176
+
177
+  (27.4ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
178
+  (0.1ms) select sqlite_version(*)
179
+  (21.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
180
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
181
+ Migrating to CreateUsers (20160213101213)
182
+  (0.1ms) begin transaction
183
+  (0.2ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar, "profile_id" integer, "employer_id" integer, "country_code" varchar NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
184
+  (0.1ms) CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
185
+  (0.1ms) SELECT sql
186
+ FROM sqlite_master
187
+ WHERE name='index_users_on_email' AND type='index'
188
+ UNION ALL
189
+ SELECT sql
190
+ FROM sqlite_temp_master
191
+ WHERE name='index_users_on_email' AND type='index'
192
+
193
+  (0.1ms) CREATE INDEX "index_users_on_employer_id_and_country_code" ON "users" ("employer_id", "country_code")
194
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160213101213"]]
195
+  (29.8ms) commit transaction
196
+ Migrating to CreateProfiles (20160213101232)
197
+  (0.1ms) begin transaction
198
+  (0.2ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "first_name" varchar, "last_name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
199
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160213101232"]]
200
+  (32.3ms) commit transaction
201
+ Migrating to CreateEmployers (20160213102131)
202
+  (0.0ms) begin transaction
203
+  (0.2ms) CREATE TABLE "employers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
204
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160213102131"]]
205
+  (32.9ms) commit transaction
206
+ ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
207
+  (0.0ms)  SELECT sql
208
+ FROM sqlite_master
209
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
210
+ UNION ALL
211
+ SELECT sql
212
+ FROM sqlite_temp_master
213
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
214
+ 
215
+  (0.0ms) SELECT sql
216
+ FROM sqlite_master
217
+ WHERE name='index_users_on_email' AND type='index'
218
+ UNION ALL
219
+ SELECT sql
220
+ FROM sqlite_temp_master
221
+ WHERE name='index_users_on_email' AND type='index'
222
+
223
+  (0.1ms)  SELECT sql
224
+ FROM sqlite_master
225
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
226
+ UNION ALL
227
+ SELECT sql
228
+ FROM sqlite_temp_master
229
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
230
+ 
231
+  (0.0ms) SELECT sql
232
+ FROM sqlite_master
233
+ WHERE name='index_users_on_email' AND type='index'
234
+ UNION ALL
235
+ SELECT sql
236
+ FROM sqlite_temp_master
237
+ WHERE name='index_users_on_email' AND type='index'
238
+
239
+  (0.0ms)  SELECT sql
240
+ FROM sqlite_master
241
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
242
+ UNION ALL
243
+ SELECT sql
244
+ FROM sqlite_temp_master
245
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
246
+ 
247
+  (0.0ms) SELECT sql
248
+ FROM sqlite_master
249
+ WHERE name='index_users_on_email' AND type='index'
250
+ UNION ALL
251
+ SELECT sql
252
+ FROM sqlite_temp_master
253
+ WHERE name='index_users_on_email' AND type='index'
254
+
255
+  (0.1ms)  SELECT sql
256
+ FROM sqlite_master
257
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
258
+ UNION ALL
259
+ SELECT sql
260
+ FROM sqlite_temp_master
261
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
262
+ 
263
+  (0.0ms) SELECT sql
264
+ FROM sqlite_master
265
+ WHERE name='index_users_on_email' AND type='index'
266
+ UNION ALL
267
+ SELECT sql
268
+ FROM sqlite_temp_master
269
+ WHERE name='index_users_on_email' AND type='index'
270
+
271
+  (0.0ms)  SELECT sql
272
+ FROM sqlite_master
273
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
274
+ UNION ALL
275
+ SELECT sql
276
+ FROM sqlite_temp_master
277
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
278
+ 
279
+  (0.0ms) SELECT sql
280
+ FROM sqlite_master
281
+ WHERE name='index_users_on_email' AND type='index'
282
+ UNION ALL
283
+ SELECT sql
284
+ FROM sqlite_temp_master
285
+ WHERE name='index_users_on_email' AND type='index'
286
+
287
+  (0.1ms)  SELECT sql
288
+ FROM sqlite_master
289
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
290
+ UNION ALL
291
+ SELECT sql
292
+ FROM sqlite_temp_master
293
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
294
+ 
295
+  (0.0ms) SELECT sql
296
+ FROM sqlite_master
297
+ WHERE name='index_users_on_email' AND type='index'
298
+ UNION ALL
299
+ SELECT sql
300
+ FROM sqlite_temp_master
301
+ WHERE name='index_users_on_email' AND type='index'
302
+
303
+  (0.0ms)  SELECT sql
304
+ FROM sqlite_master
305
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
306
+ UNION ALL
307
+ SELECT sql
308
+ FROM sqlite_temp_master
309
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
310
+ 
311
+  (0.0ms) SELECT sql
312
+ FROM sqlite_master
313
+ WHERE name='index_users_on_email' AND type='index'
314
+ UNION ALL
315
+ SELECT sql
316
+ FROM sqlite_temp_master
317
+ WHERE name='index_users_on_email' AND type='index'
318
+
319
+  (0.1ms)  SELECT sql
320
+ FROM sqlite_master
321
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
322
+ UNION ALL
323
+ SELECT sql
324
+ FROM sqlite_temp_master
325
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
326
+ 
327
+  (0.0ms) SELECT sql
328
+ FROM sqlite_master
329
+ WHERE name='index_users_on_email' AND type='index'
330
+ UNION ALL
331
+ SELECT sql
332
+ FROM sqlite_temp_master
333
+ WHERE name='index_users_on_email' AND type='index'
334
+
335
+  (0.0ms)  SELECT sql
336
+ FROM sqlite_master
337
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
338
+ UNION ALL
339
+ SELECT sql
340
+ FROM sqlite_temp_master
341
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
342
+ 
343
+  (0.0ms) SELECT sql
344
+ FROM sqlite_master
345
+ WHERE name='index_users_on_email' AND type='index'
346
+ UNION ALL
347
+ SELECT sql
348
+ FROM sqlite_temp_master
349
+ WHERE name='index_users_on_email' AND type='index'
350
+
351
+  (0.2ms)  SELECT sql
352
+ FROM sqlite_master
353
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
354
+ UNION ALL
355
+ SELECT sql
356
+ FROM sqlite_temp_master
357
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
358
+ 
359
+  (0.0ms) SELECT sql
360
+ FROM sqlite_master
361
+ WHERE name='index_users_on_email' AND type='index'
362
+ UNION ALL
363
+ SELECT sql
364
+ FROM sqlite_temp_master
365
+ WHERE name='index_users_on_email' AND type='index'
366
+
367
+  (0.0ms)  SELECT sql
368
+ FROM sqlite_master
369
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
370
+ UNION ALL
371
+ SELECT sql
372
+ FROM sqlite_temp_master
373
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
374
+ 
375
+  (0.0ms) SELECT sql
376
+ FROM sqlite_master
377
+ WHERE name='index_users_on_email' AND type='index'
378
+ UNION ALL
379
+ SELECT sql
380
+ FROM sqlite_temp_master
381
+ WHERE name='index_users_on_email' AND type='index'
382
+
383
+  (0.1ms)  SELECT sql
384
+ FROM sqlite_master
385
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
386
+ UNION ALL
387
+ SELECT sql
388
+ FROM sqlite_temp_master
389
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
390
+ 
391
+  (0.0ms) SELECT sql
392
+ FROM sqlite_master
393
+ WHERE name='index_users_on_email' AND type='index'
394
+ UNION ALL
395
+ SELECT sql
396
+ FROM sqlite_temp_master
397
+ WHERE name='index_users_on_email' AND type='index'
398
+
399
+  (0.0ms)  SELECT sql
400
+ FROM sqlite_master
401
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
402
+ UNION ALL
403
+ SELECT sql
404
+ FROM sqlite_temp_master
405
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
406
+ 
407
+  (0.0ms) SELECT sql
408
+ FROM sqlite_master
409
+ WHERE name='index_users_on_email' AND type='index'
410
+ UNION ALL
411
+ SELECT sql
412
+ FROM sqlite_temp_master
413
+ WHERE name='index_users_on_email' AND type='index'
414
+
415
+  (0.1ms)  SELECT sql
416
+ FROM sqlite_master
417
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
418
+ UNION ALL
419
+ SELECT sql
420
+ FROM sqlite_temp_master
421
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
422
+ 
423
+  (0.0ms) SELECT sql
424
+ FROM sqlite_master
425
+ WHERE name='index_users_on_email' AND type='index'
426
+ UNION ALL
427
+ SELECT sql
428
+ FROM sqlite_temp_master
429
+ WHERE name='index_users_on_email' AND type='index'
430
+
431
+  (0.0ms)  SELECT sql
432
+ FROM sqlite_master
433
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
434
+ UNION ALL
435
+ SELECT sql
436
+ FROM sqlite_temp_master
437
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
438
+ 
439
+  (0.2ms) SELECT sql
440
+ FROM sqlite_master
441
+ WHERE name='index_users_on_email' AND type='index'
442
+ UNION ALL
443
+ SELECT sql
444
+ FROM sqlite_temp_master
445
+ WHERE name='index_users_on_email' AND type='index'
446
+
447
+  (0.1ms)  SELECT sql
448
+ FROM sqlite_master
449
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
450
+ UNION ALL
451
+ SELECT sql
452
+ FROM sqlite_temp_master
453
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
454
+ 
455
+  (0.0ms) SELECT sql
456
+ FROM sqlite_master
457
+ WHERE name='index_users_on_email' AND type='index'
458
+ UNION ALL
459
+ SELECT sql
460
+ FROM sqlite_temp_master
461
+ WHERE name='index_users_on_email' AND type='index'
462
+
463
+  (0.0ms)  SELECT sql
464
+ FROM sqlite_master
465
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
466
+ UNION ALL
467
+ SELECT sql
468
+ FROM sqlite_temp_master
469
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
470
+ 
471
+  (0.0ms) SELECT sql
472
+ FROM sqlite_master
473
+ WHERE name='index_users_on_email' AND type='index'
474
+ UNION ALL
475
+ SELECT sql
476
+ FROM sqlite_temp_master
477
+ WHERE name='index_users_on_email' AND type='index'
478
+
479
+ ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
480
+ Migrating to IndexForeignKeysInUsers (20160402143434)
481
+  (0.0ms) begin transaction
482
+  (0.0ms) select sqlite_version(*)
483
+  (0.1ms) SELECT sql
484
+ FROM sqlite_master
485
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
486
+ UNION ALL
487
+ SELECT sql
488
+ FROM sqlite_temp_master
489
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
490
+
491
+  (0.1ms)  SELECT sql
492
+ FROM sqlite_master
493
+ WHERE name='index_users_on_email' AND type='index'
494
+ UNION ALL
495
+ SELECT sql
496
+ FROM sqlite_temp_master
497
+ WHERE name='index_users_on_email' AND type='index'
498
+ 
499
+  (0.3ms) CREATE INDEX "index_users_on_profile_id" ON "users" ("profile_id")
500
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160402143434"]]
501
+  (21.3ms) commit transaction
502
+ ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
503
+  (0.1ms) SELECT sql
504
+ FROM sqlite_master
505
+ WHERE name='index_users_on_profile_id' AND type='index'
506
+ UNION ALL
507
+ SELECT sql
508
+ FROM sqlite_temp_master
509
+ WHERE name='index_users_on_profile_id' AND type='index'
510
+
511
+  (0.0ms)  SELECT sql
512
+ FROM sqlite_master
513
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
514
+ UNION ALL
515
+ SELECT sql
516
+ FROM sqlite_temp_master
517
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
518
+ 
519
+  (0.0ms) SELECT sql
520
+ FROM sqlite_master
521
+ WHERE name='index_users_on_email' AND type='index'
522
+ UNION ALL
523
+ SELECT sql
524
+ FROM sqlite_temp_master
525
+ WHERE name='index_users_on_email' AND type='index'
526
+
527
+  (0.1ms)  SELECT sql
528
+ FROM sqlite_master
529
+ WHERE name='index_users_on_profile_id' AND type='index'
530
+ UNION ALL
531
+ SELECT sql
532
+ FROM sqlite_temp_master
533
+ WHERE name='index_users_on_profile_id' AND type='index'
534
+ 
535
+  (0.0ms) SELECT sql
536
+ FROM sqlite_master
537
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
538
+ UNION ALL
539
+ SELECT sql
540
+ FROM sqlite_temp_master
541
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
542
+
543
+  (0.0ms)  SELECT sql
544
+ FROM sqlite_master
545
+ WHERE name='index_users_on_email' AND type='index'
546
+ UNION ALL
547
+ SELECT sql
548
+ FROM sqlite_temp_master
549
+ WHERE name='index_users_on_email' AND type='index'
550
+ 
551
+  (0.0ms) SELECT sql
552
+ FROM sqlite_master
553
+ WHERE name='index_users_on_profile_id' AND type='index'
554
+ UNION ALL
555
+ SELECT sql
556
+ FROM sqlite_temp_master
557
+ WHERE name='index_users_on_profile_id' AND type='index'
558
+
559
+  (0.0ms)  SELECT sql
560
+ FROM sqlite_master
561
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
562
+ UNION ALL
563
+ SELECT sql
564
+ FROM sqlite_temp_master
565
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
566
+ 
567
+  (0.0ms) SELECT sql
568
+ FROM sqlite_master
569
+ WHERE name='index_users_on_email' AND type='index'
570
+ UNION ALL
571
+ SELECT sql
572
+ FROM sqlite_temp_master
573
+ WHERE name='index_users_on_email' AND type='index'
574
+
575
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
576
+ ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
577
+ Migrating to IndexForeignKeysInUsers (20160402143434)
578
+  (0.0ms) begin transaction
579
+  (0.1ms) SELECT sql
580
+ FROM sqlite_master
581
+ WHERE name='index_users_on_profile_id' AND type='index'
582
+ UNION ALL
583
+ SELECT sql
584
+ FROM sqlite_temp_master
585
+ WHERE name='index_users_on_profile_id' AND type='index'
586
+
587
+  (0.0ms)  SELECT sql
588
+ FROM sqlite_master
589
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
590
+ UNION ALL
591
+ SELECT sql
592
+ FROM sqlite_temp_master
593
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
594
+ 
595
+  (0.0ms) SELECT sql
596
+ FROM sqlite_master
597
+ WHERE name='index_users_on_email' AND type='index'
598
+ UNION ALL
599
+ SELECT sql
600
+ FROM sqlite_temp_master
601
+ WHERE name='index_users_on_email' AND type='index'
602
+
603
+  (0.1ms) DROP INDEX "index_users_on_profile_id"
604
+ SQL (0.1ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = ? [["version", "20160402143434"]]
605
+  (25.1ms) commit transaction
606
+ ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
607
+  (0.1ms)  SELECT sql
608
+ FROM sqlite_master
609
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
610
+ UNION ALL
611
+ SELECT sql
612
+ FROM sqlite_temp_master
613
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
614
+ 
615
+  (0.0ms) SELECT sql
616
+ FROM sqlite_master
617
+ WHERE name='index_users_on_email' AND type='index'
618
+ UNION ALL
619
+ SELECT sql
620
+ FROM sqlite_temp_master
621
+ WHERE name='index_users_on_email' AND type='index'
622
+
623
+  (0.1ms)  SELECT sql
624
+ FROM sqlite_master
625
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
626
+ UNION ALL
627
+ SELECT sql
628
+ FROM sqlite_temp_master
629
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
630
+ 
631
+  (0.0ms) SELECT sql
632
+ FROM sqlite_master
633
+ WHERE name='index_users_on_email' AND type='index'
634
+ UNION ALL
635
+ SELECT sql
636
+ FROM sqlite_temp_master
637
+ WHERE name='index_users_on_email' AND type='index'
638
+
639
+  (0.0ms)  SELECT sql
640
+ FROM sqlite_master
641
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
642
+ UNION ALL
643
+ SELECT sql
644
+ FROM sqlite_temp_master
645
+ WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
646
+ 
647
+  (0.0ms) SELECT sql
648
+ FROM sqlite_master
649
+ WHERE name='index_users_on_email' AND type='index'
650
+ UNION ALL
651
+ SELECT sql
652
+ FROM sqlite_temp_master
653
+ WHERE name='index_users_on_email' AND type='index'
654
+