views 0.0.1 → 4.0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -19
  3. data/lib/generators/view/templates/migration.rb +5 -0
  4. data/lib/generators/{views → view}/templates/view.sql +0 -0
  5. data/lib/generators/view/view_generator.rb +24 -0
  6. data/lib/views.rb +7 -50
  7. data/lib/views/extensions/active_record/abstract_adapter.rb +17 -0
  8. data/lib/views/extensions/active_record/command_recorder.rb +26 -0
  9. data/lib/views/extensions/active_record/postgresql_adapter.rb +39 -0
  10. data/lib/views/extensions/active_record/schema_dumper.rb +28 -0
  11. data/lib/views/railtie.rb +17 -0
  12. data/lib/views/version.rb +3 -1
  13. data/test/dummy/bin/bundle +1 -0
  14. data/test/dummy/bin/rails +1 -0
  15. data/test/dummy/bin/rake +1 -0
  16. data/test/dummy/bin/setup +2 -1
  17. data/test/dummy/config/database.yml +2 -5
  18. data/test/dummy/config/database.yml.travis +2 -11
  19. data/test/dummy/config/environments/development.rb +1 -1
  20. data/test/dummy/config/environments/production.rb +1 -1
  21. data/test/dummy/config/environments/test.rb +2 -2
  22. data/test/dummy/config/initializers/mime_types.rb +1 -1
  23. data/test/dummy/config/secrets.yml +2 -2
  24. data/test/dummy/db/migrate/20161125151623_create_guitars_view.rb +5 -0
  25. data/test/dummy/db/schema.rb +3 -1
  26. data/test/dummy/db/views/guitars.sql +2 -2
  27. data/test/dummy/log/development.log +2897 -24
  28. data/test/dummy/log/test.log +1545 -915
  29. data/test/dummy/public/404.html +57 -63
  30. data/test/dummy/public/422.html +57 -63
  31. data/test/dummy/public/500.html +56 -62
  32. data/test/{generators_test.rb → generator_test.rb} +4 -4
  33. data/test/migration_test.rb +20 -0
  34. data/test/task_test.rb +25 -0
  35. metadata +19 -10
  36. data/lib/generators/views/view_generator.rb +0 -15
  37. data/lib/tasks/views.rake +0 -7
  38. data/test/tasks_test.rb +0 -28
@@ -1,18 +1,2720 @@
1
+ ActiveRecord::SchemaMigration Load (24.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
2
+  (2.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
3
+ FROM pg_constraint c
4
+ JOIN pg_class t1 ON c.conrelid = t1.oid
5
+ JOIN pg_class t2 ON c.confrelid = t2.oid
6
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
7
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
8
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
9
+ WHERE c.contype = 'f'
10
+ AND t1.relname = 'products'
11
+ AND t3.nspname = ANY (current_schemas(false))
12
+ ORDER BY c.conname
13
+
14
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
15
+  (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
16
+ FROM pg_constraint c
17
+ JOIN pg_class t1 ON c.conrelid = t1.oid
18
+ JOIN pg_class t2 ON c.confrelid = t2.oid
19
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
20
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
21
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
22
+ WHERE c.contype = 'f'
23
+ AND t1.relname = 'products'
24
+ AND t3.nspname = ANY (current_schemas(false))
25
+ ORDER BY c.conname
26
+
27
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
28
+  (2.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
29
+ FROM pg_constraint c
30
+ JOIN pg_class t1 ON c.conrelid = t1.oid
31
+ JOIN pg_class t2 ON c.confrelid = t2.oid
32
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
33
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
34
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
35
+ WHERE c.contype = 'f'
36
+ AND t1.relname = 'products'
37
+ AND t3.nspname = ANY (current_schemas(false))
38
+ ORDER BY c.conname
39
+
40
+ ActiveRecord::SchemaMigration Load (5.9ms) SELECT "schema_migrations".* FROM "schema_migrations"
41
+  (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
42
+ FROM pg_constraint c
43
+ JOIN pg_class t1 ON c.conrelid = t1.oid
44
+ JOIN pg_class t2 ON c.confrelid = t2.oid
45
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
46
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
47
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
48
+ WHERE c.contype = 'f'
49
+ AND t1.relname = 'products'
50
+ AND t3.nspname = ANY (current_schemas(false))
51
+ ORDER BY c.conname
52
+
53
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
54
+  (2.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
55
+ FROM pg_constraint c
56
+ JOIN pg_class t1 ON c.conrelid = t1.oid
57
+ JOIN pg_class t2 ON c.confrelid = t2.oid
58
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
59
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
60
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
61
+ WHERE c.contype = 'f'
62
+ AND t1.relname = 'products'
63
+ AND t3.nspname = ANY (current_schemas(false))
64
+ ORDER BY c.conname
65
+
66
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
67
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
68
+  (14.1ms) DROP VIEW test
69
+ ActiveRecord::SchemaMigration Load (6.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
70
+  (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
71
+ FROM pg_constraint c
72
+ JOIN pg_class t1 ON c.conrelid = t1.oid
73
+ JOIN pg_class t2 ON c.confrelid = t2.oid
74
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
75
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
76
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
77
+ WHERE c.contype = 'f'
78
+ AND t1.relname = 'products'
79
+ AND t3.nspname = ANY (current_schemas(false))
80
+ ORDER BY c.conname
81
+
82
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
83
+  (2.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
84
+ FROM pg_constraint c
85
+ JOIN pg_class t1 ON c.conrelid = t1.oid
86
+ JOIN pg_class t2 ON c.confrelid = t2.oid
87
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
88
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
89
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
90
+ WHERE c.contype = 'f'
91
+ AND t1.relname = 'products'
92
+ AND t3.nspname = ANY (current_schemas(false))
93
+ ORDER BY c.conname
94
+
95
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
96
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
97
+  (5.6ms) SELECT
98
+ c.relname as name,
99
+ pg_get_viewdef(c.oid) AS definition,
100
+ c.relkind AS kind,
101
+ n.nspname AS namespace
102
+ FROM
103
+ pg_class c
104
+ LEFT JOIN
105
+ pg_namespace n ON
106
+ n.oid = c.relnamespace
107
+ WHERE
108
+ c.relkind IN ('m', 'v') AND
109
+ c.relname NOT IN (SELECT extname FROM pg_extension) AND
110
+ n.nspname = ANY (current_schemas(false))
111
+ ORDER BY c.oid
112
+
113
+  (1.0ms)  SELECT
114
+ c.relname as name,
115
+ pg_get_viewdef(c.oid) AS definition,
116
+ c.relkind AS kind,
117
+ n.nspname AS namespace
118
+ FROM
119
+ pg_class c
120
+ LEFT JOIN
121
+ pg_namespace n ON
122
+ n.oid = c.relnamespace
123
+ WHERE
124
+ c.relkind IN ('m', 'v') AND
125
+ c.relname NOT IN (SELECT extname FROM pg_extension) AND
126
+ n.nspname = ANY (current_schemas(false))
127
+ ORDER BY c.oid
128
+ 
129
+  (22.5ms) CREATE VIEW testing AS SELECT * FROM products
130
+  (6.2ms)  SELECT
131
+ c.relname as name,
132
+ pg_get_viewdef(c.oid) AS definition,
133
+ c.relkind AS kind,
134
+ n.nspname AS namespace
135
+ FROM
136
+ pg_class c
137
+ LEFT JOIN
138
+ pg_namespace n ON
139
+ n.oid = c.relnamespace
140
+ WHERE
141
+ c.relkind IN ('m', 'v') AND
142
+ c.relname NOT IN (SELECT extname FROM pg_extension) AND
143
+ n.nspname = ANY (current_schemas(false))
144
+ ORDER BY c.oid
145
+ 
146
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
147
+  (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
148
+ FROM pg_constraint c
149
+ JOIN pg_class t1 ON c.conrelid = t1.oid
150
+ JOIN pg_class t2 ON c.confrelid = t2.oid
151
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
152
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
153
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
154
+ WHERE c.contype = 'f'
155
+ AND t1.relname = 'products'
156
+ AND t3.nspname = ANY (current_schemas(false))
157
+ ORDER BY c.conname
158
+
159
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
160
+ FROM pg_class c
161
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
162
+ WHERE c.relkind IN ('m', 'v')
163
+ AND n.nspname = ANY (current_schemas(false))
164
+ 
165
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
166
+  (2.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
167
+ FROM pg_constraint c
168
+ JOIN pg_class t1 ON c.conrelid = t1.oid
169
+ JOIN pg_class t2 ON c.confrelid = t2.oid
170
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
171
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
172
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
173
+ WHERE c.contype = 'f'
174
+ AND t1.relname = 'products'
175
+ AND t3.nspname = ANY (current_schemas(false))
176
+ ORDER BY c.conname
177
+
178
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
179
+ FROM pg_class c
180
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
181
+ WHERE c.relkind IN ('m', 'v')
182
+ AND n.nspname = ANY (current_schemas(false))
183
+ 
184
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
185
+  (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
186
+ FROM pg_constraint c
187
+ JOIN pg_class t1 ON c.conrelid = t1.oid
188
+ JOIN pg_class t2 ON c.confrelid = t2.oid
189
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
190
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
191
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
192
+ WHERE c.contype = 'f'
193
+ AND t1.relname = 'products'
194
+ AND t3.nspname = ANY (current_schemas(false))
195
+ ORDER BY c.conname
196
+
197
+  (0.7ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
198
+ FROM pg_class c
199
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
200
+ WHERE c.relkind IN ('m', 'v')
201
+ AND n.nspname = ANY (current_schemas(false))
202
+ 
203
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
204
+  (2.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
205
+ FROM pg_constraint c
206
+ JOIN pg_class t1 ON c.conrelid = t1.oid
207
+ JOIN pg_class t2 ON c.confrelid = t2.oid
208
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
209
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
210
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
211
+ WHERE c.contype = 'f'
212
+ AND t1.relname = 'products'
213
+ AND t3.nspname = ANY (current_schemas(false))
214
+ ORDER BY c.conname
215
+
216
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
217
+ FROM pg_class c
218
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
219
+ WHERE c.relkind IN ('m', 'v')
220
+ AND n.nspname = ANY (current_schemas(false))
221
+ 
222
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
223
+  (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
224
+ FROM pg_constraint c
225
+ JOIN pg_class t1 ON c.conrelid = t1.oid
226
+ JOIN pg_class t2 ON c.confrelid = t2.oid
227
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
228
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
229
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
230
+ WHERE c.contype = 'f'
231
+ AND t1.relname = 'products'
232
+ AND t3.nspname = ANY (current_schemas(false))
233
+ ORDER BY c.conname
234
+
235
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
236
+ FROM pg_class c
237
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
238
+ WHERE c.relkind IN ('m', 'v')
239
+ AND n.nspname = ANY (current_schemas(false))
240
+ 
241
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
242
+  (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
243
+ FROM pg_constraint c
244
+ JOIN pg_class t1 ON c.conrelid = t1.oid
245
+ JOIN pg_class t2 ON c.confrelid = t2.oid
246
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
247
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
248
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
249
+ WHERE c.contype = 'f'
250
+ AND t1.relname = 'products'
251
+ AND t3.nspname = ANY (current_schemas(false))
252
+ ORDER BY c.conname
253
+
254
+  (0.9ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
255
+ FROM pg_class c
256
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
257
+ WHERE c.relkind IN ('m', 'v')
258
+ AND n.nspname = ANY (current_schemas(false))
259
+ 
260
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
261
+  (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
262
+ FROM pg_constraint c
263
+ JOIN pg_class t1 ON c.conrelid = t1.oid
264
+ JOIN pg_class t2 ON c.confrelid = t2.oid
265
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
266
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
267
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
268
+ WHERE c.contype = 'f'
269
+ AND t1.relname = 'products'
270
+ AND t3.nspname = ANY (current_schemas(false))
271
+ ORDER BY c.conname
272
+
273
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
274
+ FROM pg_class c
275
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
276
+ WHERE c.relkind IN ('m', 'v')
277
+ AND n.nspname = ANY (current_schemas(false))
278
+ 
279
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
280
+  (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
281
+ FROM pg_constraint c
282
+ JOIN pg_class t1 ON c.conrelid = t1.oid
283
+ JOIN pg_class t2 ON c.confrelid = t2.oid
284
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
285
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
286
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
287
+ WHERE c.contype = 'f'
288
+ AND t1.relname = 'products'
289
+ AND t3.nspname = ANY (current_schemas(false))
290
+ ORDER BY c.conname
291
+
292
+  (0.9ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
293
+ FROM pg_class c
294
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
295
+ WHERE c.relkind IN ('m', 'v')
296
+ AND n.nspname = ANY (current_schemas(false))
297
+ 
298
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
299
+  (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
300
+ FROM pg_constraint c
301
+ JOIN pg_class t1 ON c.conrelid = t1.oid
302
+ JOIN pg_class t2 ON c.confrelid = t2.oid
303
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
304
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
305
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
306
+ WHERE c.contype = 'f'
307
+ AND t1.relname = 'products'
308
+ AND t3.nspname = ANY (current_schemas(false))
309
+ ORDER BY c.conname
310
+
311
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
312
+ FROM pg_class c
313
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
314
+ WHERE c.relkind IN ('m', 'v')
315
+ AND n.nspname = ANY (current_schemas(false))
316
+ 
317
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
318
+  (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
319
+ FROM pg_constraint c
320
+ JOIN pg_class t1 ON c.conrelid = t1.oid
321
+ JOIN pg_class t2 ON c.confrelid = t2.oid
322
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
323
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
324
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
325
+ WHERE c.contype = 'f'
326
+ AND t1.relname = 'products'
327
+ AND t3.nspname = ANY (current_schemas(false))
328
+ ORDER BY c.conname
329
+
330
+  (0.7ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
331
+ FROM pg_class c
332
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
333
+ WHERE c.relkind IN ('m', 'v')
334
+ AND n.nspname = ANY (current_schemas(false))
335
+ 
336
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
337
+  (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
338
+ FROM pg_constraint c
339
+ JOIN pg_class t1 ON c.conrelid = t1.oid
340
+ JOIN pg_class t2 ON c.confrelid = t2.oid
341
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
342
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
343
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
344
+ WHERE c.contype = 'f'
345
+ AND t1.relname = 'products'
346
+ AND t3.nspname = ANY (current_schemas(false))
347
+ ORDER BY c.conname
348
+
349
+  (0.7ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
350
+ FROM pg_class c
351
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
352
+ WHERE c.relkind IN ('m', 'v')
353
+ AND n.nspname = ANY (current_schemas(false))
354
+ 
355
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
356
+  (2.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
357
+ FROM pg_constraint c
358
+ JOIN pg_class t1 ON c.conrelid = t1.oid
359
+ JOIN pg_class t2 ON c.confrelid = t2.oid
360
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
361
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
362
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
363
+ WHERE c.contype = 'f'
364
+ AND t1.relname = 'products'
365
+ AND t3.nspname = ANY (current_schemas(false))
366
+ ORDER BY c.conname
367
+
368
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
369
+ FROM pg_class c
370
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
371
+ WHERE c.relkind IN ('m', 'v')
372
+ AND n.nspname = ANY (current_schemas(false))
373
+ 
374
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
375
+  (2.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
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 = 'products'
384
+ AND t3.nspname = ANY (current_schemas(false))
385
+ ORDER BY c.conname
386
+
387
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
388
+ FROM pg_class c
389
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
390
+ WHERE c.relkind IN ('m', 'v')
391
+ AND n.nspname = ANY (current_schemas(false))
392
+ 
393
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
394
+  (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
395
+ FROM pg_constraint c
396
+ JOIN pg_class t1 ON c.conrelid = t1.oid
397
+ JOIN pg_class t2 ON c.confrelid = t2.oid
398
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
399
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
400
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
401
+ WHERE c.contype = 'f'
402
+ AND t1.relname = 'products'
403
+ AND t3.nspname = ANY (current_schemas(false))
404
+ ORDER BY c.conname
405
+
406
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
407
+ FROM pg_class c
408
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
409
+ WHERE c.relkind IN ('m', 'v')
410
+ AND n.nspname = ANY (current_schemas(false))
411
+ 
412
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
413
+  (2.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
414
+ FROM pg_constraint c
415
+ JOIN pg_class t1 ON c.conrelid = t1.oid
416
+ JOIN pg_class t2 ON c.confrelid = t2.oid
417
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
418
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
419
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
420
+ WHERE c.contype = 'f'
421
+ AND t1.relname = 'products'
422
+ AND t3.nspname = ANY (current_schemas(false))
423
+ ORDER BY c.conname
424
+
425
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
426
+ FROM pg_class c
427
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
428
+ WHERE c.relkind IN ('m', 'v')
429
+ AND n.nspname = ANY (current_schemas(false))
430
+ 
431
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
432
+  (2.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
433
+ FROM pg_constraint c
434
+ JOIN pg_class t1 ON c.conrelid = t1.oid
435
+ JOIN pg_class t2 ON c.confrelid = t2.oid
436
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
437
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
438
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
439
+ WHERE c.contype = 'f'
440
+ AND t1.relname = 'products'
441
+ AND t3.nspname = ANY (current_schemas(false))
442
+ ORDER BY c.conname
443
+
444
+  (0.9ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
445
+ FROM pg_class c
446
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
447
+ WHERE c.relkind IN ('m', 'v')
448
+ AND n.nspname = ANY (current_schemas(false))
449
+ 
450
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
451
+  (2.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
452
+ FROM pg_constraint c
453
+ JOIN pg_class t1 ON c.conrelid = t1.oid
454
+ JOIN pg_class t2 ON c.confrelid = t2.oid
455
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
456
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
457
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
458
+ WHERE c.contype = 'f'
459
+ AND t1.relname = 'products'
460
+ AND t3.nspname = ANY (current_schemas(false))
461
+ ORDER BY c.conname
462
+
463
+  (0.9ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
464
+ FROM pg_class c
465
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
466
+ WHERE c.relkind IN ('m', 'v')
467
+ AND n.nspname = ANY (current_schemas(false))
468
+ 
469
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
470
+  (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
471
+ FROM pg_constraint c
472
+ JOIN pg_class t1 ON c.conrelid = t1.oid
473
+ JOIN pg_class t2 ON c.confrelid = t2.oid
474
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
475
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
476
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
477
+ WHERE c.contype = 'f'
478
+ AND t1.relname = 'products'
479
+ AND t3.nspname = ANY (current_schemas(false))
480
+ ORDER BY c.conname
481
+
482
+  (0.7ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
483
+ FROM pg_class c
484
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
485
+ WHERE c.relkind IN ('m', 'v')
486
+ AND n.nspname = ANY (current_schemas(false))
487
+ 
488
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
489
+  (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
490
+ FROM pg_constraint c
491
+ JOIN pg_class t1 ON c.conrelid = t1.oid
492
+ JOIN pg_class t2 ON c.confrelid = t2.oid
493
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
494
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
495
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
496
+ WHERE c.contype = 'f'
497
+ AND t1.relname = 'products'
498
+ AND t3.nspname = ANY (current_schemas(false))
499
+ ORDER BY c.conname
500
+
501
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
502
+ FROM pg_class c
503
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
504
+ WHERE c.relkind IN ('m', 'v')
505
+ AND n.nspname = ANY (current_schemas(false))
506
+ 
507
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
508
+  (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
509
+ FROM pg_constraint c
510
+ JOIN pg_class t1 ON c.conrelid = t1.oid
511
+ JOIN pg_class t2 ON c.confrelid = t2.oid
512
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
513
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
514
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
515
+ WHERE c.contype = 'f'
516
+ AND t1.relname = 'products'
517
+ AND t3.nspname = ANY (current_schemas(false))
518
+ ORDER BY c.conname
519
+
520
+  (0.7ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
521
+ FROM pg_class c
522
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
523
+ WHERE c.relkind IN ('m', 'v')
524
+ AND n.nspname = ANY (current_schemas(false))
525
+ 
526
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
527
+  (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
528
+ FROM pg_constraint c
529
+ JOIN pg_class t1 ON c.conrelid = t1.oid
530
+ JOIN pg_class t2 ON c.confrelid = t2.oid
531
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
532
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
533
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
534
+ WHERE c.contype = 'f'
535
+ AND t1.relname = 'products'
536
+ AND t3.nspname = ANY (current_schemas(false))
537
+ ORDER BY c.conname
538
+
539
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
540
+ FROM pg_class c
541
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
542
+ WHERE c.relkind IN ('m', 'v')
543
+ AND n.nspname = ANY (current_schemas(false))
544
+ 
545
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
546
+  (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
547
+ FROM pg_constraint c
548
+ JOIN pg_class t1 ON c.conrelid = t1.oid
549
+ JOIN pg_class t2 ON c.confrelid = t2.oid
550
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
551
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
552
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
553
+ WHERE c.contype = 'f'
554
+ AND t1.relname = 'products'
555
+ AND t3.nspname = ANY (current_schemas(false))
556
+ ORDER BY c.conname
557
+
558
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
559
+ FROM pg_class c
560
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
561
+ WHERE c.relkind IN ('m', 'v')
562
+ AND n.nspname = ANY (current_schemas(false))
563
+ 
564
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
565
+  (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
566
+ FROM pg_constraint c
567
+ JOIN pg_class t1 ON c.conrelid = t1.oid
568
+ JOIN pg_class t2 ON c.confrelid = t2.oid
569
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
570
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
571
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
572
+ WHERE c.contype = 'f'
573
+ AND t1.relname = 'products'
574
+ AND t3.nspname = ANY (current_schemas(false))
575
+ ORDER BY c.conname
576
+
577
+  (0.9ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
578
+ FROM pg_class c
579
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
580
+ WHERE c.relkind IN ('m', 'v')
581
+ AND n.nspname = ANY (current_schemas(false))
582
+ 
583
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
584
+  (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
585
+ FROM pg_constraint c
586
+ JOIN pg_class t1 ON c.conrelid = t1.oid
587
+ JOIN pg_class t2 ON c.confrelid = t2.oid
588
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
589
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
590
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
591
+ WHERE c.contype = 'f'
592
+ AND t1.relname = 'products'
593
+ AND t3.nspname = ANY (current_schemas(false))
594
+ ORDER BY c.conname
595
+
596
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
597
+ FROM pg_class c
598
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
599
+ WHERE c.relkind IN ('m', 'v')
600
+ AND n.nspname = ANY (current_schemas(false))
601
+ 
602
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
603
+  (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
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 = 'products'
612
+ AND t3.nspname = ANY (current_schemas(false))
613
+ ORDER BY c.conname
614
+
615
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
616
+ FROM pg_class c
617
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
618
+ WHERE c.relkind IN ('m', 'v')
619
+ AND n.nspname = ANY (current_schemas(false))
620
+ 
621
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
622
+  (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
623
+ FROM pg_constraint c
624
+ JOIN pg_class t1 ON c.conrelid = t1.oid
625
+ JOIN pg_class t2 ON c.confrelid = t2.oid
626
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
627
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
628
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
629
+ WHERE c.contype = 'f'
630
+ AND t1.relname = 'products'
631
+ AND t3.nspname = ANY (current_schemas(false))
632
+ ORDER BY c.conname
633
+
634
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
635
+ FROM pg_class c
636
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
637
+ WHERE c.relkind IN ('m', 'v')
638
+ AND n.nspname = ANY (current_schemas(false))
639
+ 
640
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
641
+  (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
642
+ FROM pg_constraint c
643
+ JOIN pg_class t1 ON c.conrelid = t1.oid
644
+ JOIN pg_class t2 ON c.confrelid = t2.oid
645
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
646
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
647
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
648
+ WHERE c.contype = 'f'
649
+ AND t1.relname = 'products'
650
+ AND t3.nspname = ANY (current_schemas(false))
651
+ ORDER BY c.conname
652
+
653
+  (0.7ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
654
+ FROM pg_class c
655
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
656
+ WHERE c.relkind IN ('m', 'v')
657
+ AND n.nspname = ANY (current_schemas(false))
658
+ 
659
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
660
+  (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
661
+ FROM pg_constraint c
662
+ JOIN pg_class t1 ON c.conrelid = t1.oid
663
+ JOIN pg_class t2 ON c.confrelid = t2.oid
664
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
665
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
666
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
667
+ WHERE c.contype = 'f'
668
+ AND t1.relname = 'products'
669
+ AND t3.nspname = ANY (current_schemas(false))
670
+ ORDER BY c.conname
671
+
672
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
673
+ FROM pg_class c
674
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
675
+ WHERE c.relkind IN ('m', 'v')
676
+ AND n.nspname = ANY (current_schemas(false))
677
+ 
678
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
679
+  (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
680
+ FROM pg_constraint c
681
+ JOIN pg_class t1 ON c.conrelid = t1.oid
682
+ JOIN pg_class t2 ON c.confrelid = t2.oid
683
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
684
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
685
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
686
+ WHERE c.contype = 'f'
687
+ AND t1.relname = 'products'
688
+ AND t3.nspname = ANY (current_schemas(false))
689
+ ORDER BY c.conname
690
+
691
+  (1.1ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
692
+ FROM pg_class c
693
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
694
+ WHERE c.relkind IN ('m', 'v')
695
+ AND n.nspname = ANY (current_schemas(false))
696
+ 
697
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
698
+  (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
699
+ FROM pg_constraint c
700
+ JOIN pg_class t1 ON c.conrelid = t1.oid
701
+ JOIN pg_class t2 ON c.confrelid = t2.oid
702
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
703
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
704
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
705
+ WHERE c.contype = 'f'
706
+ AND t1.relname = 'products'
707
+ AND t3.nspname = ANY (current_schemas(false))
708
+ ORDER BY c.conname
709
+
710
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
711
+ FROM pg_class c
712
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
713
+ WHERE c.relkind IN ('m', 'v')
714
+ AND n.nspname = ANY (current_schemas(false))
715
+ 
716
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
717
+  (2.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
718
+ FROM pg_constraint c
719
+ JOIN pg_class t1 ON c.conrelid = t1.oid
720
+ JOIN pg_class t2 ON c.confrelid = t2.oid
721
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
722
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
723
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
724
+ WHERE c.contype = 'f'
725
+ AND t1.relname = 'products'
726
+ AND t3.nspname = ANY (current_schemas(false))
727
+ ORDER BY c.conname
728
+
729
+  (0.9ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
730
+ FROM pg_class c
731
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
732
+ WHERE c.relkind IN ('m', 'v')
733
+ AND n.nspname = ANY (current_schemas(false))
734
+ 
735
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
736
+  (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
737
+ FROM pg_constraint c
738
+ JOIN pg_class t1 ON c.conrelid = t1.oid
739
+ JOIN pg_class t2 ON c.confrelid = t2.oid
740
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
741
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
742
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
743
+ WHERE c.contype = 'f'
744
+ AND t1.relname = 'products'
745
+ AND t3.nspname = ANY (current_schemas(false))
746
+ ORDER BY c.conname
747
+
748
+  (0.7ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
749
+ FROM pg_class c
750
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
751
+ WHERE c.relkind IN ('m', 'v')
752
+ AND n.nspname = ANY (current_schemas(false))
753
+ 
754
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
755
+  (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
756
+ FROM pg_constraint c
757
+ JOIN pg_class t1 ON c.conrelid = t1.oid
758
+ JOIN pg_class t2 ON c.confrelid = t2.oid
759
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
760
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
761
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
762
+ WHERE c.contype = 'f'
763
+ AND t1.relname = 'products'
764
+ AND t3.nspname = ANY (current_schemas(false))
765
+ ORDER BY c.conname
766
+
767
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
768
+ FROM pg_class c
769
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
770
+ WHERE c.relkind IN ('m', 'v')
771
+ AND n.nspname = ANY (current_schemas(false))
772
+ 
773
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
774
+  (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
775
+ FROM pg_constraint c
776
+ JOIN pg_class t1 ON c.conrelid = t1.oid
777
+ JOIN pg_class t2 ON c.confrelid = t2.oid
778
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
779
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
780
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
781
+ WHERE c.contype = 'f'
782
+ AND t1.relname = 'products'
783
+ AND t3.nspname = ANY (current_schemas(false))
784
+ ORDER BY c.conname
785
+
786
+  (0.9ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
787
+ FROM pg_class c
788
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
789
+ WHERE c.relkind IN ('m', 'v')
790
+ AND n.nspname = ANY (current_schemas(false))
791
+ 
792
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
793
+  (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
794
+ FROM pg_constraint c
795
+ JOIN pg_class t1 ON c.conrelid = t1.oid
796
+ JOIN pg_class t2 ON c.confrelid = t2.oid
797
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
798
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
799
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
800
+ WHERE c.contype = 'f'
801
+ AND t1.relname = 'products'
802
+ AND t3.nspname = ANY (current_schemas(false))
803
+ ORDER BY c.conname
804
+
805
+  (0.9ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
806
+ FROM pg_class c
807
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
808
+ WHERE c.relkind IN ('m', 'v')
809
+ AND n.nspname = ANY (current_schemas(false))
810
+ 
811
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
812
+  (2.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
813
+ FROM pg_constraint c
814
+ JOIN pg_class t1 ON c.conrelid = t1.oid
815
+ JOIN pg_class t2 ON c.confrelid = t2.oid
816
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
817
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
818
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
819
+ WHERE c.contype = 'f'
820
+ AND t1.relname = 'products'
821
+ AND t3.nspname = ANY (current_schemas(false))
822
+ ORDER BY c.conname
823
+
824
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
825
+ FROM pg_class c
826
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
827
+ WHERE c.relkind IN ('m', 'v')
828
+ AND n.nspname = ANY (current_schemas(false))
829
+ 
830
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
831
+  (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
832
+ FROM pg_constraint c
833
+ JOIN pg_class t1 ON c.conrelid = t1.oid
834
+ JOIN pg_class t2 ON c.confrelid = t2.oid
835
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
836
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
837
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
838
+ WHERE c.contype = 'f'
839
+ AND t1.relname = 'products'
840
+ AND t3.nspname = ANY (current_schemas(false))
841
+ ORDER BY c.conname
842
+
843
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
844
+ FROM pg_class c
845
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
846
+ WHERE c.relkind IN ('m', 'v')
847
+ AND n.nspname = ANY (current_schemas(false))
848
+ 
849
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
850
+  (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
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 = 'products'
859
+ AND t3.nspname = ANY (current_schemas(false))
860
+ ORDER BY c.conname
861
+
862
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
863
+ FROM pg_class c
864
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
865
+ WHERE c.relkind IN ('m', 'v')
866
+ AND n.nspname = ANY (current_schemas(false))
867
+ 
868
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
869
+  (2.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
870
+ FROM pg_constraint c
871
+ JOIN pg_class t1 ON c.conrelid = t1.oid
872
+ JOIN pg_class t2 ON c.confrelid = t2.oid
873
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
874
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
875
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
876
+ WHERE c.contype = 'f'
877
+ AND t1.relname = 'products'
878
+ AND t3.nspname = ANY (current_schemas(false))
879
+ ORDER BY c.conname
880
+
881
+  (0.9ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
882
+ FROM pg_class c
883
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
884
+ WHERE c.relkind IN ('m', 'v')
885
+ AND n.nspname = ANY (current_schemas(false))
886
+ 
887
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
888
+  (2.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
889
+ FROM pg_constraint c
890
+ JOIN pg_class t1 ON c.conrelid = t1.oid
891
+ JOIN pg_class t2 ON c.confrelid = t2.oid
892
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
893
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
894
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
895
+ WHERE c.contype = 'f'
896
+ AND t1.relname = 'products'
897
+ AND t3.nspname = ANY (current_schemas(false))
898
+ ORDER BY c.conname
899
+
900
+  (0.9ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
901
+ FROM pg_class c
902
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
903
+ WHERE c.relkind IN ('m', 'v')
904
+ AND n.nspname = ANY (current_schemas(false))
905
+ 
906
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
907
+  (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
908
+ FROM pg_constraint c
909
+ JOIN pg_class t1 ON c.conrelid = t1.oid
910
+ JOIN pg_class t2 ON c.confrelid = t2.oid
911
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
912
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
913
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
914
+ WHERE c.contype = 'f'
915
+ AND t1.relname = 'products'
916
+ AND t3.nspname = ANY (current_schemas(false))
917
+ ORDER BY c.conname
918
+
919
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
920
+ FROM pg_class c
921
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
922
+ WHERE c.relkind IN ('m', 'v')
923
+ AND n.nspname = ANY (current_schemas(false))
924
+ 
925
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
926
+  (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
927
+ FROM pg_constraint c
928
+ JOIN pg_class t1 ON c.conrelid = t1.oid
929
+ JOIN pg_class t2 ON c.confrelid = t2.oid
930
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
931
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
932
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
933
+ WHERE c.contype = 'f'
934
+ AND t1.relname = 'products'
935
+ AND t3.nspname = ANY (current_schemas(false))
936
+ ORDER BY c.conname
937
+
938
+  (0.7ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
939
+ FROM pg_class c
940
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
941
+ WHERE c.relkind IN ('m', 'v')
942
+ AND n.nspname = ANY (current_schemas(false))
943
+ 
944
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
945
+  (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
946
+ FROM pg_constraint c
947
+ JOIN pg_class t1 ON c.conrelid = t1.oid
948
+ JOIN pg_class t2 ON c.confrelid = t2.oid
949
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
950
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
951
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
952
+ WHERE c.contype = 'f'
953
+ AND t1.relname = 'products'
954
+ AND t3.nspname = ANY (current_schemas(false))
955
+ ORDER BY c.conname
956
+
957
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
958
+ FROM pg_class c
959
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
960
+ WHERE c.relkind IN ('m', 'v')
961
+ AND n.nspname = ANY (current_schemas(false))
962
+ 
963
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
964
+  (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
965
+ FROM pg_constraint c
966
+ JOIN pg_class t1 ON c.conrelid = t1.oid
967
+ JOIN pg_class t2 ON c.confrelid = t2.oid
968
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
969
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
970
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
971
+ WHERE c.contype = 'f'
972
+ AND t1.relname = 'products'
973
+ AND t3.nspname = ANY (current_schemas(false))
974
+ ORDER BY c.conname
975
+
976
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
977
+ FROM pg_class c
978
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
979
+ WHERE c.relkind IN ('m', 'v')
980
+ AND n.nspname = ANY (current_schemas(false))
981
+ 
982
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
983
+  (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
984
+ FROM pg_constraint c
985
+ JOIN pg_class t1 ON c.conrelid = t1.oid
986
+ JOIN pg_class t2 ON c.confrelid = t2.oid
987
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
988
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
989
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
990
+ WHERE c.contype = 'f'
991
+ AND t1.relname = 'products'
992
+ AND t3.nspname = ANY (current_schemas(false))
993
+ ORDER BY c.conname
994
+
995
+  (0.8ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
996
+ FROM pg_class c
997
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
998
+ WHERE c.relkind IN ('m', 'v')
999
+ AND n.nspname = ANY (current_schemas(false))
1000
+ 
1001
+  (6.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
1002
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1003
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
1004
+ Migrating to CreateProducts (20161017172847)
1005
+  (0.2ms) BEGIN
1006
+  (24.4ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
1007
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161017172847"]]
1008
+  (6.0ms) COMMIT
1009
+ Migrating to CreateGuitarsView (20161125151623)
1010
+  (6.0ms) BEGIN
1011
+  (11.2ms) CREATE VIEW guitars AS SELECT
1012
+ p1.*
1013
+ FROM
1014
+ products p1
1015
+ LEFT JOIN
1016
+ products p2 ON p2.name = p1.name
1017
+ WHERE
1018
+ p1.category = 'Guitar' AND
1019
+ p1.name = 'Test'
1020
+ 
1021
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161125151623"]]
1022
+  (0.3ms) COMMIT
1023
+ Migrating to CreateAmpsViews (20161125151801)
1024
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1025
+ Migrating to CreateAmpsView (20161125151801)
1026
+  (0.1ms) BEGIN
1027
+  (8.4ms) CREATE MATERIALIZED VIEW amps AS SELECT
1028
+ products.*
1029
+ FROM
1030
+ products
1031
+ WHERE
1032
+ products.category = 'Amps'
1033
+ 
1034
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161125151801"]]
1035
+  (1.3ms) COMMIT
1036
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
1037
+  (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
1038
+ FROM pg_constraint c
1039
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1040
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1041
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1042
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1043
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1044
+ WHERE c.contype = 'f'
1045
+ AND t1.relname = 'products'
1046
+ AND t3.nspname = ANY (current_schemas(false))
1047
+ ORDER BY c.conname
1048
+ 
1049
+  (0.9ms) SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1050
+ FROM pg_class c
1051
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1052
+ WHERE c.relkind IN ('m', 'v')
1053
+ AND n.nspname = ANY (current_schemas(false))
1054
+
1055
+  (4.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
1056
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1057
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
1058
+ Migrating to CreateProducts (20161017172847)
1059
+  (0.2ms) BEGIN
1060
+  (3.4ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
1061
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161017172847"]]
1062
+  (0.4ms) COMMIT
1063
+ Migrating to CreateGuitarsView (20161125151623)
1064
+  (0.2ms) BEGIN
1065
+  (1.4ms) CREATE VIEW guitars AS SELECT
1066
+ p1.*
1067
+ FROM
1068
+ products p1
1069
+ LEFT JOIN
1070
+ products p2 ON p2.name = p1.name
1071
+ WHERE
1072
+ p1.category = 'Guitar' AND
1073
+ p1.name = 'Test'
1074
+ 
1075
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161125151623"]]
1076
+  (0.3ms) COMMIT
1077
+ Migrating to CreateAmpsView (20161125151801)
1078
+  (0.1ms) BEGIN
1079
+  (2.7ms) CREATE MATERIALIZED VIEW amps AS SELECT
1080
+ products.*
1081
+ FROM
1082
+ products
1083
+ WHERE
1084
+ products.category = 'Amps'
1085
+ 
1086
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161125151801"]]
1087
+  (2.6ms) COMMIT
1088
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
1089
+  (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
1090
+ FROM pg_constraint c
1091
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1092
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1093
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1094
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1095
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1096
+ WHERE c.contype = 'f'
1097
+ AND t1.relname = 'products'
1098
+ AND t3.nspname = ANY (current_schemas(false))
1099
+ ORDER BY c.conname
1100
+ 
1101
+  (1.8ms) SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1102
+ FROM pg_class c
1103
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1104
+ WHERE c.relkind IN ('m', 'v')
1105
+ AND n.nspname = ANY (current_schemas(false))
1106
+
1107
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1108
+  (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
1109
+ FROM pg_constraint c
1110
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1111
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1112
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1113
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1114
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1115
+ WHERE c.contype = 'f'
1116
+ AND t1.relname = 'products'
1117
+ AND t3.nspname = ANY (current_schemas(false))
1118
+ ORDER BY c.conname
1119
+
1120
+  (0.9ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1121
+ FROM pg_class c
1122
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1123
+ WHERE c.relkind IN ('m', 'v')
1124
+ AND n.nspname = ANY (current_schemas(false))
1125
+ 
1126
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1127
+  (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
1128
+ FROM pg_constraint c
1129
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1130
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1131
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1132
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1133
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1134
+ WHERE c.contype = 'f'
1135
+ AND t1.relname = 'products'
1136
+ AND t3.nspname = ANY (current_schemas(false))
1137
+ ORDER BY c.conname
1138
+
1139
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1140
+ FROM pg_class c
1141
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1142
+ WHERE c.relkind IN ('m', 'v')
1143
+ AND n.nspname = ANY (current_schemas(false))
1144
+ 
1145
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
1146
+  (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
1147
+ FROM pg_constraint c
1148
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1149
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1150
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1151
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1152
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1153
+ WHERE c.contype = 'f'
1154
+ AND t1.relname = 'products'
1155
+ AND t3.nspname = ANY (current_schemas(false))
1156
+ ORDER BY c.conname
1157
+
1158
+  (0.9ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1159
+ FROM pg_class c
1160
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1161
+ WHERE c.relkind IN ('m', 'v')
1162
+ AND n.nspname = ANY (current_schemas(false))
1163
+ 
1164
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
1165
+  (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
1166
+ FROM pg_constraint c
1167
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1168
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1169
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1170
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1171
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1172
+ WHERE c.contype = 'f'
1173
+ AND t1.relname = 'products'
1174
+ AND t3.nspname = ANY (current_schemas(false))
1175
+ ORDER BY c.conname
1176
+
1177
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1178
+ FROM pg_class c
1179
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1180
+ WHERE c.relkind IN ('m', 'v')
1181
+ AND n.nspname = ANY (current_schemas(false))
1182
+ 
1183
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1184
+  (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
1185
+ FROM pg_constraint c
1186
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1187
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1188
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1189
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1190
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1191
+ WHERE c.contype = 'f'
1192
+ AND t1.relname = 'products'
1193
+ AND t3.nspname = ANY (current_schemas(false))
1194
+ ORDER BY c.conname
1195
+
1196
+  (0.9ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1197
+ FROM pg_class c
1198
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1199
+ WHERE c.relkind IN ('m', 'v')
1200
+ AND n.nspname = ANY (current_schemas(false))
1201
+ 
1202
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1203
+  (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
1204
+ FROM pg_constraint c
1205
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1206
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1207
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1208
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1209
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1210
+ WHERE c.contype = 'f'
1211
+ AND t1.relname = 'products'
1212
+ AND t3.nspname = ANY (current_schemas(false))
1213
+ ORDER BY c.conname
1214
+
1215
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1216
+ FROM pg_class c
1217
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1218
+ WHERE c.relkind IN ('m', 'v')
1219
+ AND n.nspname = ANY (current_schemas(false))
1220
+ 
1221
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1222
+  (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
1223
+ FROM pg_constraint c
1224
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1225
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1226
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1227
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1228
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1229
+ WHERE c.contype = 'f'
1230
+ AND t1.relname = 'products'
1231
+ AND t3.nspname = ANY (current_schemas(false))
1232
+ ORDER BY c.conname
1233
+
1234
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1235
+ FROM pg_class c
1236
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1237
+ WHERE c.relkind IN ('m', 'v')
1238
+ AND n.nspname = ANY (current_schemas(false))
1239
+ 
1240
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
1241
+  (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
1242
+ FROM pg_constraint c
1243
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1244
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1245
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1246
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1247
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1248
+ WHERE c.contype = 'f'
1249
+ AND t1.relname = 'products'
1250
+ AND t3.nspname = ANY (current_schemas(false))
1251
+ ORDER BY c.conname
1252
+
1253
+  (1.1ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1254
+ FROM pg_class c
1255
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1256
+ WHERE c.relkind IN ('m', 'v')
1257
+ AND n.nspname = ANY (current_schemas(false))
1258
+ 
1259
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
1260
+  (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
1261
+ FROM pg_constraint c
1262
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1263
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1264
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1265
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1266
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1267
+ WHERE c.contype = 'f'
1268
+ AND t1.relname = 'products'
1269
+ AND t3.nspname = ANY (current_schemas(false))
1270
+ ORDER BY c.conname
1271
+
1272
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1273
+ FROM pg_class c
1274
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1275
+ WHERE c.relkind IN ('m', 'v')
1276
+ AND n.nspname = ANY (current_schemas(false))
1277
+ 
1278
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1279
+  (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
1280
+ FROM pg_constraint c
1281
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1282
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1283
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1284
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1285
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1286
+ WHERE c.contype = 'f'
1287
+ AND t1.relname = 'products'
1288
+ AND t3.nspname = ANY (current_schemas(false))
1289
+ ORDER BY c.conname
1290
+
1291
+  (1.2ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1292
+ FROM pg_class c
1293
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1294
+ WHERE c.relkind IN ('m', 'v')
1295
+ AND n.nspname = ANY (current_schemas(false))
1296
+ 
1297
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
1298
+  (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
1299
+ FROM pg_constraint c
1300
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1301
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1302
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1303
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1304
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1305
+ WHERE c.contype = 'f'
1306
+ AND t1.relname = 'products'
1307
+ AND t3.nspname = ANY (current_schemas(false))
1308
+ ORDER BY c.conname
1309
+
1310
+  (1.1ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1311
+ FROM pg_class c
1312
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1313
+ WHERE c.relkind IN ('m', 'v')
1314
+ AND n.nspname = ANY (current_schemas(false))
1315
+ 
1316
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1317
+  (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
1318
+ FROM pg_constraint c
1319
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1320
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1321
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1322
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1323
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1324
+ WHERE c.contype = 'f'
1325
+ AND t1.relname = 'products'
1326
+ AND t3.nspname = ANY (current_schemas(false))
1327
+ ORDER BY c.conname
1328
+
1329
+  (1.1ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1330
+ FROM pg_class c
1331
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1332
+ WHERE c.relkind IN ('m', 'v')
1333
+ AND n.nspname = ANY (current_schemas(false))
1334
+ 
1335
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1336
+  (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
1337
+ FROM pg_constraint c
1338
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1339
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1340
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1341
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1342
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1343
+ WHERE c.contype = 'f'
1344
+ AND t1.relname = 'products'
1345
+ AND t3.nspname = ANY (current_schemas(false))
1346
+ ORDER BY c.conname
1347
+
1348
+  (0.9ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1349
+ FROM pg_class c
1350
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1351
+ WHERE c.relkind IN ('m', 'v')
1352
+ AND n.nspname = ANY (current_schemas(false))
1353
+ 
1354
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
1355
+  (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
1356
+ FROM pg_constraint c
1357
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1358
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1359
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1360
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1361
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1362
+ WHERE c.contype = 'f'
1363
+ AND t1.relname = 'products'
1364
+ AND t3.nspname = ANY (current_schemas(false))
1365
+ ORDER BY c.conname
1366
+
1367
+  (1.6ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1368
+ FROM pg_class c
1369
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1370
+ WHERE c.relkind IN ('m', 'v')
1371
+ AND n.nspname = ANY (current_schemas(false))
1372
+ 
1373
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1374
+  (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
1375
+ FROM pg_constraint c
1376
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1377
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1378
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1379
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1380
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1381
+ WHERE c.contype = 'f'
1382
+ AND t1.relname = 'products'
1383
+ AND t3.nspname = ANY (current_schemas(false))
1384
+ ORDER BY c.conname
1385
+
1386
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1387
+ FROM pg_class c
1388
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1389
+ WHERE c.relkind IN ('m', 'v')
1390
+ AND n.nspname = ANY (current_schemas(false))
1391
+ 
1392
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1393
+  (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
1394
+ FROM pg_constraint c
1395
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1396
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1397
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1398
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1399
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1400
+ WHERE c.contype = 'f'
1401
+ AND t1.relname = 'products'
1402
+ AND t3.nspname = ANY (current_schemas(false))
1403
+ ORDER BY c.conname
1404
+
1405
+  (1.2ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1406
+ FROM pg_class c
1407
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1408
+ WHERE c.relkind IN ('m', 'v')
1409
+ AND n.nspname = ANY (current_schemas(false))
1410
+ 
1411
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1412
+  (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
1413
+ FROM pg_constraint c
1414
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1415
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1416
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1417
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1418
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1419
+ WHERE c.contype = 'f'
1420
+ AND t1.relname = 'products'
1421
+ AND t3.nspname = ANY (current_schemas(false))
1422
+ ORDER BY c.conname
1423
+
1424
+  (1.1ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1425
+ FROM pg_class c
1426
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1427
+ WHERE c.relkind IN ('m', 'v')
1428
+ AND n.nspname = ANY (current_schemas(false))
1429
+ 
1430
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1431
+  (2.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
1432
+ FROM pg_constraint c
1433
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1434
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1435
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1436
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1437
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1438
+ WHERE c.contype = 'f'
1439
+ AND t1.relname = 'products'
1440
+ AND t3.nspname = ANY (current_schemas(false))
1441
+ ORDER BY c.conname
1442
+
1443
+  (2.6ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1444
+ FROM pg_class c
1445
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1446
+ WHERE c.relkind IN ('m', 'v')
1447
+ AND n.nspname = ANY (current_schemas(false))
1448
+ 
1449
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1450
+  (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
1451
+ FROM pg_constraint c
1452
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1453
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1454
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1455
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1456
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1457
+ WHERE c.contype = 'f'
1458
+ AND t1.relname = 'products'
1459
+ AND t3.nspname = ANY (current_schemas(false))
1460
+ ORDER BY c.conname
1461
+
1462
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1463
+ FROM pg_class c
1464
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1465
+ WHERE c.relkind IN ('m', 'v')
1466
+ AND n.nspname = ANY (current_schemas(false))
1467
+ 
1468
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1469
+  (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
1470
+ FROM pg_constraint c
1471
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1472
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1473
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1474
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1475
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1476
+ WHERE c.contype = 'f'
1477
+ AND t1.relname = 'products'
1478
+ AND t3.nspname = ANY (current_schemas(false))
1479
+ ORDER BY c.conname
1480
+
1481
+  (0.9ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1482
+ FROM pg_class c
1483
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1484
+ WHERE c.relkind IN ('m', 'v')
1485
+ AND n.nspname = ANY (current_schemas(false))
1486
+ 
1487
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
1488
+  (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
1489
+ FROM pg_constraint c
1490
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1491
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1492
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1493
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1494
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1495
+ WHERE c.contype = 'f'
1496
+ AND t1.relname = 'products'
1497
+ AND t3.nspname = ANY (current_schemas(false))
1498
+ ORDER BY c.conname
1499
+
1500
+  (7.3ms)  SELECT c.relname as name, pg_get_viewdef(c.oid, true) AS definition, c.relkind AS type
1501
+ FROM pg_class c
1502
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1503
+ WHERE c.relkind IN ('m', 'v')
1504
+ AND n.nspname = ANY (current_schemas(false))
1505
+ 
1506
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1507
+  (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
1508
+ FROM pg_constraint c
1509
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1510
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1511
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1512
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1513
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1514
+ WHERE c.contype = 'f'
1515
+ AND t1.relname = 'products'
1516
+ AND t3.nspname = ANY (current_schemas(false))
1517
+ ORDER BY c.conname
1518
+
1519
+  (3.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid, false) AS definition, c.relkind AS type
1520
+ FROM pg_class c
1521
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1522
+ WHERE c.relkind IN ('m', 'v')
1523
+ AND n.nspname = ANY (current_schemas(false))
1524
+ 
1525
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
1526
+  (6.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
1527
+ FROM pg_constraint c
1528
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1529
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1530
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1531
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1532
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1533
+ WHERE c.contype = 'f'
1534
+ AND t1.relname = 'products'
1535
+ AND t3.nspname = ANY (current_schemas(false))
1536
+ ORDER BY c.conname
1537
+
1538
+  (1.6ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1539
+ FROM pg_class c
1540
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1541
+ WHERE c.relkind IN ('m', 'v')
1542
+ AND n.nspname = ANY (current_schemas(false))
1543
+ 
1544
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1545
+  (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
1546
+ FROM pg_constraint c
1547
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1548
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1549
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1550
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1551
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1552
+ WHERE c.contype = 'f'
1553
+ AND t1.relname = 'products'
1554
+ AND t3.nspname = ANY (current_schemas(false))
1555
+ ORDER BY c.conname
1556
+
1557
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1558
+ FROM pg_class c
1559
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1560
+ WHERE c.relkind IN ('m', 'v')
1561
+ AND n.nspname = ANY (current_schemas(false))
1562
+ 
1563
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1564
+  (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
1565
+ FROM pg_constraint c
1566
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1567
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1568
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1569
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1570
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1571
+ WHERE c.contype = 'f'
1572
+ AND t1.relname = 'products'
1573
+ AND t3.nspname = ANY (current_schemas(false))
1574
+ ORDER BY c.conname
1575
+
1576
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1577
+ FROM pg_class c
1578
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1579
+ WHERE c.relkind IN ('m', 'v')
1580
+ AND n.nspname = ANY (current_schemas(false))
1581
+ 
1582
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1583
+  (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
1584
+ FROM pg_constraint c
1585
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1586
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1587
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1588
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1589
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1590
+ WHERE c.contype = 'f'
1591
+ AND t1.relname = 'products'
1592
+ AND t3.nspname = ANY (current_schemas(false))
1593
+ ORDER BY c.conname
1594
+
1595
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1596
+ FROM pg_class c
1597
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1598
+ WHERE c.relkind IN ('m', 'v')
1599
+ AND n.nspname = ANY (current_schemas(false))
1600
+ 
1601
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1602
+  (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
1603
+ FROM pg_constraint c
1604
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1605
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1606
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1607
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1608
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1609
+ WHERE c.contype = 'f'
1610
+ AND t1.relname = 'products'
1611
+ AND t3.nspname = ANY (current_schemas(false))
1612
+ ORDER BY c.conname
1613
+
1614
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1615
+ FROM pg_class c
1616
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1617
+ WHERE c.relkind IN ('m', 'v')
1618
+ AND n.nspname = ANY (current_schemas(false))
1619
+ 
1620
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1621
+  (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
1622
+ FROM pg_constraint c
1623
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1624
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1625
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1626
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1627
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1628
+ WHERE c.contype = 'f'
1629
+ AND t1.relname = 'products'
1630
+ AND t3.nspname = ANY (current_schemas(false))
1631
+ ORDER BY c.conname
1632
+
1633
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1634
+ FROM pg_class c
1635
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1636
+ WHERE c.relkind IN ('m', 'v')
1637
+ AND n.nspname = ANY (current_schemas(false))
1638
+ 
1639
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
1640
+  (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
1641
+ FROM pg_constraint c
1642
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1643
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1644
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1645
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1646
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1647
+ WHERE c.contype = 'f'
1648
+ AND t1.relname = 'products'
1649
+ AND t3.nspname = ANY (current_schemas(false))
1650
+ ORDER BY c.conname
1651
+
1652
+  (1.1ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1653
+ FROM pg_class c
1654
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1655
+ WHERE c.relkind IN ('m', 'v')
1656
+ AND n.nspname = ANY (current_schemas(false))
1657
+ 
1658
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
1659
+  (2.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
1660
+ FROM pg_constraint c
1661
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1662
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1663
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1664
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1665
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1666
+ WHERE c.contype = 'f'
1667
+ AND t1.relname = 'products'
1668
+ AND t3.nspname = ANY (current_schemas(false))
1669
+ ORDER BY c.conname
1670
+
1671
+  (2.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1672
+ FROM pg_class c
1673
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1674
+ WHERE c.relkind IN ('m', 'v')
1675
+ AND n.nspname = ANY (current_schemas(false))
1676
+ 
1677
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1678
+  (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
1679
+ FROM pg_constraint c
1680
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1681
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1682
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1683
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1684
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1685
+ WHERE c.contype = 'f'
1686
+ AND t1.relname = 'products'
1687
+ AND t3.nspname = ANY (current_schemas(false))
1688
+ ORDER BY c.conname
1689
+
1690
+  (1.1ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1691
+ FROM pg_class c
1692
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1693
+ WHERE c.relkind IN ('m', 'v')
1694
+ AND n.nspname = ANY (current_schemas(false))
1695
+ 
1696
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1697
+  (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
1698
+ FROM pg_constraint c
1699
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1700
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1701
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1702
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1703
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1704
+ WHERE c.contype = 'f'
1705
+ AND t1.relname = 'products'
1706
+ AND t3.nspname = ANY (current_schemas(false))
1707
+ ORDER BY c.conname
1708
+
1709
+  (1.1ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1710
+ FROM pg_class c
1711
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1712
+ WHERE c.relkind IN ('m', 'v')
1713
+ AND n.nspname = ANY (current_schemas(false))
1714
+ 
1715
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
1716
+  (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
1717
+ FROM pg_constraint c
1718
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1719
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1720
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1721
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1722
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1723
+ WHERE c.contype = 'f'
1724
+ AND t1.relname = 'products'
1725
+ AND t3.nspname = ANY (current_schemas(false))
1726
+ ORDER BY c.conname
1727
+
1728
+  (2.9ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1729
+ FROM pg_class c
1730
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1731
+ WHERE c.relkind IN ('m', 'v')
1732
+ AND n.nspname = ANY (current_schemas(false))
1733
+ 
1734
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1735
+  (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
1736
+ FROM pg_constraint c
1737
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1738
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1739
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1740
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1741
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1742
+ WHERE c.contype = 'f'
1743
+ AND t1.relname = 'products'
1744
+ AND t3.nspname = ANY (current_schemas(false))
1745
+ ORDER BY c.conname
1746
+
1747
+  (1.1ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1748
+ FROM pg_class c
1749
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1750
+ WHERE c.relkind IN ('m', 'v')
1751
+ AND n.nspname = ANY (current_schemas(false))
1752
+ 
1
1753
  ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
2
- Migrating to CreateUsers (20161017172847)
3
-  (0.2ms) BEGIN
4
-  (25.2ms) CREATE TABLE "users" ("id" serial primary key, "name" character varying, "enabled" boolean, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
5
-  (0.1ms) ROLLBACK
6
-  (2.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
7
-  (1.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1754
+  (2.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
1755
+ FROM pg_constraint c
1756
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1757
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1758
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1759
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1760
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1761
+ WHERE c.contype = 'f'
1762
+ AND t1.relname = 'products'
1763
+ AND t3.nspname = ANY (current_schemas(false))
1764
+ ORDER BY c.conname
1765
+
1766
+  (1.1ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1767
+ FROM pg_class c
1768
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1769
+ WHERE c.relkind IN ('m', 'v')
1770
+ AND n.nspname = ANY (current_schemas(false))
1771
+ 
1772
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1773
+  (2.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
1774
+ FROM pg_constraint c
1775
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1776
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1777
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1778
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1779
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1780
+ WHERE c.contype = 'f'
1781
+ AND t1.relname = 'products'
1782
+ AND t3.nspname = ANY (current_schemas(false))
1783
+ ORDER BY c.conname
1784
+
1785
+  (1.3ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1786
+ FROM pg_class c
1787
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1788
+ WHERE c.relkind IN ('m', 'v')
1789
+ AND n.nspname = ANY (current_schemas(false))
1790
+ 
1791
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
1792
+  (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
1793
+ FROM pg_constraint c
1794
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1795
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1796
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1797
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1798
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1799
+ WHERE c.contype = 'f'
1800
+ AND t1.relname = 'products'
1801
+ AND t3.nspname = ANY (current_schemas(false))
1802
+ ORDER BY c.conname
1803
+
1804
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1805
+ FROM pg_class c
1806
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1807
+ WHERE c.relkind IN ('m', 'v')
1808
+ AND n.nspname = ANY (current_schemas(false))
1809
+ 
1810
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1811
+  (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
1812
+ FROM pg_constraint c
1813
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1814
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1815
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1816
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1817
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1818
+ WHERE c.contype = 'f'
1819
+ AND t1.relname = 'products'
1820
+ AND t3.nspname = ANY (current_schemas(false))
1821
+ ORDER BY c.conname
1822
+
1823
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1824
+ FROM pg_class c
1825
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1826
+ WHERE c.relkind IN ('m', 'v')
1827
+ AND n.nspname = ANY (current_schemas(false))
1828
+ 
1829
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1830
+  (2.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
1831
+ FROM pg_constraint c
1832
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1833
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1834
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1835
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1836
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1837
+ WHERE c.contype = 'f'
1838
+ AND t1.relname = 'products'
1839
+ AND t3.nspname = ANY (current_schemas(false))
1840
+ ORDER BY c.conname
1841
+
1842
+  (1.1ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1843
+ FROM pg_class c
1844
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1845
+ WHERE c.relkind IN ('m', 'v')
1846
+ AND n.nspname = ANY (current_schemas(false))
1847
+ 
1848
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1849
+  (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
1850
+ FROM pg_constraint c
1851
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1852
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1853
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1854
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1855
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1856
+ WHERE c.contype = 'f'
1857
+ AND t1.relname = 'products'
1858
+ AND t3.nspname = ANY (current_schemas(false))
1859
+ ORDER BY c.conname
1860
+
1861
+  (1.1ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1862
+ FROM pg_class c
1863
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1864
+ WHERE c.relkind IN ('m', 'v')
1865
+ AND n.nspname = ANY (current_schemas(false))
1866
+ 
1867
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1868
+  (2.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
1869
+ FROM pg_constraint c
1870
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1871
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1872
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1873
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1874
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1875
+ WHERE c.contype = 'f'
1876
+ AND t1.relname = 'products'
1877
+ AND t3.nspname = ANY (current_schemas(false))
1878
+ ORDER BY c.conname
1879
+
1880
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1881
+ FROM pg_class c
1882
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1883
+ WHERE c.relkind IN ('m', 'v')
1884
+ AND n.nspname = ANY (current_schemas(false))
1885
+ 
1886
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1887
+  (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
1888
+ FROM pg_constraint c
1889
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1890
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1891
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1892
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1893
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1894
+ WHERE c.contype = 'f'
1895
+ AND t1.relname = 'products'
1896
+ AND t3.nspname = ANY (current_schemas(false))
1897
+ ORDER BY c.conname
1898
+
1899
+  (1.1ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1900
+ FROM pg_class c
1901
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1902
+ WHERE c.relkind IN ('m', 'v')
1903
+ AND n.nspname = ANY (current_schemas(false))
1904
+ 
1905
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1906
+  (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
1907
+ FROM pg_constraint c
1908
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1909
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1910
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1911
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1912
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1913
+ WHERE c.contype = 'f'
1914
+ AND t1.relname = 'products'
1915
+ AND t3.nspname = ANY (current_schemas(false))
1916
+ ORDER BY c.conname
1917
+
1918
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1919
+ FROM pg_class c
1920
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1921
+ WHERE c.relkind IN ('m', 'v')
1922
+ AND n.nspname = ANY (current_schemas(false))
1923
+ 
1924
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1925
+  (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
1926
+ FROM pg_constraint c
1927
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1928
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1929
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1930
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1931
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1932
+ WHERE c.contype = 'f'
1933
+ AND t1.relname = 'products'
1934
+ AND t3.nspname = ANY (current_schemas(false))
1935
+ ORDER BY c.conname
1936
+
1937
+  (0.9ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1938
+ FROM pg_class c
1939
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1940
+ WHERE c.relkind IN ('m', 'v')
1941
+ AND n.nspname = ANY (current_schemas(false))
1942
+ 
1943
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1944
+  (2.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
1945
+ FROM pg_constraint c
1946
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1947
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1948
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1949
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1950
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1951
+ WHERE c.contype = 'f'
1952
+ AND t1.relname = 'products'
1953
+ AND t3.nspname = ANY (current_schemas(false))
1954
+ ORDER BY c.conname
1955
+
1956
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1957
+ FROM pg_class c
1958
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1959
+ WHERE c.relkind IN ('m', 'v')
1960
+ AND n.nspname = ANY (current_schemas(false))
1961
+ 
1962
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1963
+  (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
1964
+ FROM pg_constraint c
1965
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1966
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1967
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1968
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1969
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1970
+ WHERE c.contype = 'f'
1971
+ AND t1.relname = 'products'
1972
+ AND t3.nspname = ANY (current_schemas(false))
1973
+ ORDER BY c.conname
1974
+
1975
+  (1.1ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1976
+ FROM pg_class c
1977
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1978
+ WHERE c.relkind IN ('m', 'v')
1979
+ AND n.nspname = ANY (current_schemas(false))
1980
+ 
1981
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
1982
+  (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
1983
+ FROM pg_constraint c
1984
+ JOIN pg_class t1 ON c.conrelid = t1.oid
1985
+ JOIN pg_class t2 ON c.confrelid = t2.oid
1986
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
1987
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
1988
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
1989
+ WHERE c.contype = 'f'
1990
+ AND t1.relname = 'products'
1991
+ AND t3.nspname = ANY (current_schemas(false))
1992
+ ORDER BY c.conname
1993
+
1994
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
1995
+ FROM pg_class c
1996
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
1997
+ WHERE c.relkind IN ('m', 'v')
1998
+ AND n.nspname = ANY (current_schemas(false))
1999
+ 
2000
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
2001
+  (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
2002
+ FROM pg_constraint c
2003
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2004
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2005
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2006
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2007
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2008
+ WHERE c.contype = 'f'
2009
+ AND t1.relname = 'products'
2010
+ AND t3.nspname = ANY (current_schemas(false))
2011
+ ORDER BY c.conname
2012
+
2013
+  (1.1ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
2014
+ FROM pg_class c
2015
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2016
+ WHERE c.relkind IN ('m', 'v')
2017
+ AND n.nspname = ANY (current_schemas(false))
2018
+ 
2019
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
2020
+  (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
2021
+ FROM pg_constraint c
2022
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2023
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2024
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2025
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2026
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2027
+ WHERE c.contype = 'f'
2028
+ AND t1.relname = 'products'
2029
+ AND t3.nspname = ANY (current_schemas(false))
2030
+ ORDER BY c.conname
2031
+
2032
+  (1.1ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
2033
+ FROM pg_class c
2034
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2035
+ WHERE c.relkind IN ('m', 'v')
2036
+ AND n.nspname = ANY (current_schemas(false))
2037
+ 
2038
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
2039
+  (2.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
2040
+ FROM pg_constraint c
2041
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2042
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2043
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2044
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2045
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2046
+ WHERE c.contype = 'f'
2047
+ AND t1.relname = 'products'
2048
+ AND t3.nspname = ANY (current_schemas(false))
2049
+ ORDER BY c.conname
2050
+
2051
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
2052
+ FROM pg_class c
2053
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2054
+ WHERE c.relkind IN ('m', 'v')
2055
+ AND n.nspname = ANY (current_schemas(false))
2056
+ 
2057
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
2058
+  (2.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
2059
+ FROM pg_constraint c
2060
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2061
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2062
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2063
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2064
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2065
+ WHERE c.contype = 'f'
2066
+ AND t1.relname = 'products'
2067
+ AND t3.nspname = ANY (current_schemas(false))
2068
+ ORDER BY c.conname
2069
+
2070
+  (1.1ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
2071
+ FROM pg_class c
2072
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2073
+ WHERE c.relkind IN ('m', 'v')
2074
+ AND n.nspname = ANY (current_schemas(false))
2075
+ 
2076
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
2077
+  (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
2078
+ FROM pg_constraint c
2079
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2080
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2081
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2082
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2083
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2084
+ WHERE c.contype = 'f'
2085
+ AND t1.relname = 'products'
2086
+ AND t3.nspname = ANY (current_schemas(false))
2087
+ ORDER BY c.conname
2088
+
2089
+  (1.1ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
2090
+ FROM pg_class c
2091
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2092
+ WHERE c.relkind IN ('m', 'v')
2093
+ AND n.nspname = ANY (current_schemas(false))
2094
+ 
2095
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
2096
+  (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
2097
+ FROM pg_constraint c
2098
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2099
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2100
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2101
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2102
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2103
+ WHERE c.contype = 'f'
2104
+ AND t1.relname = 'products'
2105
+ AND t3.nspname = ANY (current_schemas(false))
2106
+ ORDER BY c.conname
2107
+
2108
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
2109
+ FROM pg_class c
2110
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2111
+ WHERE c.relkind IN ('m', 'v')
2112
+ AND n.nspname = ANY (current_schemas(false))
2113
+ 
2114
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
2115
+  (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
2116
+ FROM pg_constraint c
2117
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2118
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2119
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2120
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2121
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2122
+ WHERE c.contype = 'f'
2123
+ AND t1.relname = 'products'
2124
+ AND t3.nspname = ANY (current_schemas(false))
2125
+ ORDER BY c.conname
2126
+
2127
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
2128
+ FROM pg_class c
2129
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2130
+ WHERE c.relkind IN ('m', 'v')
2131
+ AND n.nspname = ANY (current_schemas(false))
2132
+ 
2133
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
2134
+  (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
2135
+ FROM pg_constraint c
2136
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2137
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2138
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2139
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2140
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2141
+ WHERE c.contype = 'f'
2142
+ AND t1.relname = 'products'
2143
+ AND t3.nspname = ANY (current_schemas(false))
2144
+ ORDER BY c.conname
2145
+
2146
+  (0.9ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
2147
+ FROM pg_class c
2148
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2149
+ WHERE c.relkind IN ('m', 'v')
2150
+ AND n.nspname = ANY (current_schemas(false))
2151
+ 
2152
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
2153
+  (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
2154
+ FROM pg_constraint c
2155
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2156
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2157
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2158
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2159
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2160
+ WHERE c.contype = 'f'
2161
+ AND t1.relname = 'products'
2162
+ AND t3.nspname = ANY (current_schemas(false))
2163
+ ORDER BY c.conname
2164
+
2165
+  (1.1ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
2166
+ FROM pg_class c
2167
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2168
+ WHERE c.relkind IN ('m', 'v')
2169
+ AND n.nspname = ANY (current_schemas(false))
2170
+ 
2171
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
2172
+  (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
2173
+ FROM pg_constraint c
2174
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2175
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2176
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2177
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2178
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2179
+ WHERE c.contype = 'f'
2180
+ AND t1.relname = 'products'
2181
+ AND t3.nspname = ANY (current_schemas(false))
2182
+ ORDER BY c.conname
2183
+
2184
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
2185
+ FROM pg_class c
2186
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2187
+ WHERE c.relkind IN ('m', 'v')
2188
+ AND n.nspname = ANY (current_schemas(false))
2189
+ 
2190
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
2191
+  (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
2192
+ FROM pg_constraint c
2193
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2194
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2195
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2196
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2197
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2198
+ WHERE c.contype = 'f'
2199
+ AND t1.relname = 'products'
2200
+ AND t3.nspname = ANY (current_schemas(false))
2201
+ ORDER BY c.conname
2202
+
2203
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
2204
+ FROM pg_class c
2205
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2206
+ WHERE c.relkind IN ('m', 'v')
2207
+ AND n.nspname = ANY (current_schemas(false))
2208
+ 
2209
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
2210
+  (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
2211
+ FROM pg_constraint c
2212
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2213
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2214
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2215
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2216
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2217
+ WHERE c.contype = 'f'
2218
+ AND t1.relname = 'products'
2219
+ AND t3.nspname = ANY (current_schemas(false))
2220
+ ORDER BY c.conname
2221
+
2222
+  (1.0ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
2223
+ FROM pg_class c
2224
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2225
+ WHERE c.relkind IN ('m', 'v')
2226
+ AND n.nspname = ANY (current_schemas(false))
2227
+ 
2228
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
2229
+  (2.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
2230
+ FROM pg_constraint c
2231
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2232
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2233
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2234
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2235
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2236
+ WHERE c.contype = 'f'
2237
+ AND t1.relname = 'products'
2238
+ AND t3.nspname = ANY (current_schemas(false))
2239
+ ORDER BY c.conname
2240
+
2241
+  (1.2ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
2242
+ FROM pg_class c
2243
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2244
+ WHERE c.relkind IN ('m', 'v')
2245
+ AND n.nspname = ANY (current_schemas(false))
2246
+ 
2247
+ SQL (11.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2248
+  (9.8ms) DROP TABLE "products" CASCADE
2249
+  (7.9ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
2250
+  (1.5ms) CREATE VIEW guitars AS SELECT p1.id,
2251
+ p1.name,
2252
+ p1.category,
2253
+ p1.created_at,
2254
+ p1.updated_at
2255
+ FROM (products p1
2256
+ LEFT JOIN products p2 ON (((p2.name)::text = (p1.name)::text)))
2257
+ WHERE (((p1.category)::text = 'Guitar'::text) AND ((p1.name)::text = 'Test'::text));
2258
+
2259
+  (3.9ms) CREATE MATERIALIZED VIEW amps AS SELECT products.id,
2260
+ products.name,
2261
+ products.category,
2262
+ products.created_at,
2263
+ products.updated_at
2264
+ FROM products
2265
+ WHERE ((products.category)::text = 'Amps'::text);
2266
+ 
2267
+  (0.3ms) SELECT version FROM "schema_migrations"
2268
+ SQL (1.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2269
+  (22.1ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
2270
+  (5.3ms) CREATE VIEW guitars AS SELECT p1.id,
2271
+ p1.name,
2272
+ p1.category,
2273
+ p1.created_at,
2274
+ p1.updated_at
2275
+ FROM (products p1
2276
+ LEFT JOIN products p2 ON (((p2.name)::text = (p1.name)::text)))
2277
+ WHERE (((p1.category)::text = 'Guitar'::text) AND ((p1.name)::text = 'Test'::text));
2278
+ 
2279
+  (4.2ms) CREATE MATERIALIZED VIEW amps AS SELECT products.id,
2280
+ products.name,
2281
+ products.category,
2282
+ products.created_at,
2283
+ products.updated_at
2284
+ FROM products
2285
+ WHERE ((products.category)::text = 'Amps'::text);
2286
+
2287
+  (2.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
2288
+  (1.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2289
+  (0.5ms) SELECT version FROM "schema_migrations"
2290
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20161125151801')
2291
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20161017172847')
2292
+  (0.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20161125151623')
2293
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
2294
+  (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
2295
+ FROM pg_constraint c
2296
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2297
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2298
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2299
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2300
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2301
+ WHERE c.contype = 'f'
2302
+ AND t1.relname = 'products'
2303
+ AND t3.nspname = ANY (current_schemas(false))
2304
+ ORDER BY c.conname
2305
+
2306
+  (1.2ms)  SELECT c.relname as name, pg_get_viewdef(c.oid) AS definition, c.relkind AS type
2307
+ FROM pg_class c
2308
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2309
+ WHERE c.relkind IN ('m', 'v')
2310
+ AND n.nspname = ANY (current_schemas(false))
2311
+ 
2312
+ SQL (0.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2313
+  (7.6ms) DROP TABLE "products" CASCADE
2314
+  (2.6ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
2315
+  (1.0ms) CREATE VIEW guitars AS SELECT p1.id,
2316
+ p1.name,
2317
+ p1.category,
2318
+ p1.created_at,
2319
+ p1.updated_at
2320
+ FROM (products p1
2321
+ LEFT JOIN products p2 ON (((p2.name)::text = (p1.name)::text)))
2322
+ WHERE (((p1.category)::text = 'Guitar'::text) AND ((p1.name)::text = 'Test'::text));
2323
+
2324
+  (2.5ms) CREATE MATERIALIZED VIEW amps AS SELECT products.id,
2325
+ products.name,
2326
+ products.category,
2327
+ products.created_at,
2328
+ products.updated_at
2329
+ FROM products
2330
+ WHERE ((products.category)::text = 'Amps'::text);
2331
+ 
2332
+  (0.4ms) SELECT version FROM "schema_migrations"
2333
+ SQL (0.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2334
+  (14.3ms) DROP TABLE "products" CASCADE
2335
+  (3.4ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
2336
+  (1.2ms) CREATE VIEW guitars AS SELECT p1.id,
2337
+ p1.name,
2338
+ p1.category,
2339
+ p1.created_at,
2340
+ p1.updated_at
2341
+ FROM (products p1
2342
+ LEFT JOIN products p2 ON (((p2.name)::text = (p1.name)::text)))
2343
+ WHERE (((p1.category)::text = 'Guitar'::text) AND ((p1.name)::text = 'Test'::text));
2344
+
2345
+  (2.0ms) CREATE MATERIALIZED VIEW amps AS SELECT products.id,
2346
+ products.name,
2347
+ products.category,
2348
+ products.created_at,
2349
+ products.updated_at
2350
+ FROM products
2351
+ WHERE ((products.category)::text = 'Amps'::text);
2352
+ 
2353
+  (0.3ms) SELECT version FROM "schema_migrations"
2354
+  (23.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
2355
+  (14.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
8
2356
  ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
9
- Migrating to CreateUsers (20161017172847)
2357
+ Migrating to CreateProducts (20161017172847)
10
2358
   (0.1ms) BEGIN
11
-  (2.4ms) CREATE TABLE "users" ("id" serial primary key, "name" character varying, "enabled" boolean, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
2359
+  (17.9ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
12
2360
  SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161017172847"]]
13
-  (6.3ms) COMMIT
2361
+  (5.4ms) COMMIT
2362
+ Migrating to CreateGuitarsView (20161125151623)
2363
+  (5.4ms) BEGIN
2364
+  (2.1ms) CREATE VIEW guitars AS
2365
+ SELECT
2366
+ p1.*
2367
+ FROM
2368
+ products p1
2369
+ LEFT JOIN
2370
+ products p2 ON p2.name = p1.name
2371
+ WHERE
2372
+ p1.category = 'Guitar' AND
2373
+ p1.name = 'Test'
2374
+ 
2375
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161125151623"]]
2376
+  (5.6ms) COMMIT
2377
+ Migrating to CreateAmpsView (20161125151801)
2378
+  (0.2ms) BEGIN
2379
+  (2.2ms) CREATE MATERIALIZED VIEW amps AS
2380
+ SELECT
2381
+ products.*
2382
+ FROM
2383
+ products
2384
+ WHERE
2385
+ products.category = 'Amps'
2386
+ 
2387
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161125151801"]]
2388
+  (0.3ms) COMMIT
2389
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
2390
+  (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
2391
+ FROM pg_constraint c
2392
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2393
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2394
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2395
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2396
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2397
+ WHERE c.contype = 'f'
2398
+ AND t1.relname = 'products'
2399
+ AND t3.nspname = ANY (current_schemas(false))
2400
+ ORDER BY c.conname
2401
+ 
2402
+  (0.4ms) SELECT c.relname as name, c.relkind AS type
2403
+ FROM pg_class c
2404
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2405
+ WHERE c.relkind IN ('m', 'v')
2406
+ AND n.nspname = ANY (current_schemas(false))
2407
+
2408
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
2409
+  (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
2410
+ FROM pg_constraint c
2411
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2412
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2413
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2414
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2415
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2416
+ WHERE c.contype = 'f'
2417
+ AND t1.relname = 'products'
2418
+ AND t3.nspname = ANY (current_schemas(false))
2419
+ ORDER BY c.conname
2420
+
2421
+  (0.4ms)  SELECT c.relname as name, c.relkind AS type
2422
+ FROM pg_class c
2423
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2424
+ WHERE c.relkind IN ('m', 'v')
2425
+ AND n.nspname = ANY (current_schemas(false))
2426
+ 
2427
+ SQL (0.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2428
+  (5.1ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
2429
+  (12.3ms) CREATE VIEW guitars AS
2430
+ SELECT
2431
+ p1.*
2432
+ FROM
2433
+ products p1
2434
+ LEFT JOIN
2435
+ products p2 ON p2.name = p1.name
2436
+ WHERE
2437
+ p1.category = 'Guitar' AND
2438
+ p1.name = 'Test'
2439
+ 
2440
+  (14.4ms) CREATE MATERIALIZED VIEW amps AS
2441
+ SELECT
2442
+ products.*
2443
+ FROM
2444
+ products
2445
+ WHERE
2446
+ products.category = 'Amps'
2447
+
2448
+  (4.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
2449
+  (1.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2450
+  (0.5ms) SELECT version FROM "schema_migrations"
2451
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20161125151801')
2452
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20161017172847')
2453
+  (0.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20161125151623')
2454
+ SQL (1.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2455
+  (18.9ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
2456
+  (4.2ms) CREATE VIEW guitars AS
2457
+ SELECT
2458
+ p1.*
2459
+ FROM
2460
+ products p1
2461
+ LEFT JOIN
2462
+ products p2 ON p2.name = p1.name
2463
+ WHERE
2464
+ p1.category = 'Guitar' AND
2465
+ p1.name = 'Test'
2466
+ 
2467
+  (4.0ms) CREATE MATERIALIZED VIEW amps AS
2468
+ SELECT
2469
+ products.*
2470
+ FROM
2471
+ products
2472
+ WHERE
2473
+ products.category = 'Amps'
2474
+
2475
+  (1.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
2476
+  (1.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2477
+  (0.4ms) SELECT version FROM "schema_migrations"
2478
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20161125151801')
2479
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20161017172847')
2480
+  (0.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20161125151623')
2481
+ SQL (0.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2482
+  (24.4ms) DROP TABLE "products" CASCADE
2483
+  (2.4ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
2484
+  (11.7ms) CREATE VIEW guitars AS
2485
+ SELECT
2486
+ p1.*
2487
+ FROM
2488
+ products p1
2489
+ LEFT JOIN
2490
+ products p2 ON p2.name = p1.name
2491
+ WHERE
2492
+ p1.category = 'Guitar' AND
2493
+ p1.name = 'Test'
2494
+
2495
+  (12.7ms) CREATE MATERIALIZED VIEW amps AS
2496
+ SELECT
2497
+ products.*
2498
+ FROM
2499
+ products
2500
+ WHERE
2501
+ products.category = 'Amps'
2502
+ 
2503
+  (0.3ms) SELECT version FROM "schema_migrations"
2504
+ SQL (0.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2505
+  (3.7ms) DROP TABLE "products" CASCADE
2506
+  (4.0ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
2507
+  (2.2ms) CREATE VIEW guitars AS
2508
+ SELECT
2509
+ p1.*
2510
+ FROM
2511
+ products p1
2512
+ LEFT JOIN
2513
+ products p2 ON p2.name = p1.name
2514
+ WHERE
2515
+ p1.category = 'Guitar' AND
2516
+ p1.name = 'Test'
2517
+
2518
+  (3.0ms) CREATE MATERIALIZED VIEW amps AS
2519
+ SELECT
2520
+ products.*
2521
+ FROM
2522
+ products
2523
+ WHERE
2524
+ products.category = 'Amps'
2525
+ 
2526
+  (0.3ms) SELECT version FROM "schema_migrations"
2527
+ SQL (0.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2528
+  (4.2ms) DROP TABLE "products" CASCADE
2529
+  (4.6ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
2530
+  (1.6ms) CREATE VIEW guitars AS
2531
+ SELECT
2532
+ p1.*
2533
+ FROM
2534
+ products p1
2535
+ LEFT JOIN
2536
+ products p2 ON p2.name = p1.name
2537
+ WHERE
2538
+ p1.category = 'Guitar' AND
2539
+ p1.name = 'Test'
2540
+
2541
+  (2.3ms) CREATE MATERIALIZED VIEW amps AS
2542
+ SELECT
2543
+ products.*
2544
+ FROM
2545
+ products
2546
+ WHERE
2547
+ products.category = 'Amps'
2548
+ 
2549
+  (0.3ms) SELECT version FROM "schema_migrations"
2550
+ SQL (0.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2551
+  (2.4ms) DROP TABLE "products" CASCADE
2552
+  (3.4ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
2553
+  (1.1ms) CREATE VIEW guitars AS
2554
+ SELECT
2555
+ p1.*
2556
+ FROM
2557
+ products p1
2558
+ LEFT JOIN
2559
+ products p2 ON p2.name = p1.name
2560
+ WHERE
2561
+ p1.category = 'Guitar' AND
2562
+ p1.name = 'Test'
2563
+
2564
+  (1.8ms) CREATE MATERIALIZED VIEW amps AS
2565
+ SELECT
2566
+ products.*
2567
+ FROM
2568
+ products
2569
+ WHERE
2570
+ products.category = 'Amps'
2571
+ 
2572
+  (0.3ms) SELECT version FROM "schema_migrations"
2573
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
2574
+  (2.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
2575
+ FROM pg_constraint c
2576
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2577
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2578
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2579
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2580
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2581
+ WHERE c.contype = 'f'
2582
+ AND t1.relname = 'products'
2583
+ AND t3.nspname = ANY (current_schemas(false))
2584
+ ORDER BY c.conname
2585
+
2586
+  (0.4ms)  SELECT c.relname as name, c.relkind AS type
2587
+ FROM pg_class c
2588
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2589
+ WHERE c.relkind IN ('m', 'v')
2590
+ AND n.nspname = ANY (current_schemas(false))
2591
+ 
2592
+ SQL (0.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2593
+  (24.4ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
2594
+  (0.4ms) DROP VIEW IF EXISTS guitars
2595
+  (6.5ms) CREATE VIEW guitars AS
2596
+ SELECT
2597
+ p1.*
2598
+ FROM
2599
+ products p1
2600
+ LEFT JOIN
2601
+ products p2 ON p2.name = p1.name
2602
+ WHERE
2603
+ p1.category = 'Guitar' AND
2604
+ p1.name = 'Test'
2605
+
2606
+  (0.2ms) DROP VIEW IF EXISTS amps
2607
+  (14.0ms) CREATE MATERIALIZED VIEW amps AS
2608
+ SELECT
2609
+ products.*
2610
+ FROM
2611
+ products
2612
+ WHERE
2613
+ products.category = 'Amps'
2614
+
2615
+  (11.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
2616
+  (9.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2617
+  (0.3ms) SELECT version FROM "schema_migrations"
2618
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20161125151801')
2619
+  (0.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20161017172847')
2620
+  (0.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20161125151623')
2621
+ SQL (0.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2622
+  (3.6ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
2623
+  (0.2ms) DROP VIEW IF EXISTS guitars
2624
+  (1.6ms) CREATE VIEW guitars AS
2625
+ SELECT
2626
+ p1.*
2627
+ FROM
2628
+ products p1
2629
+ LEFT JOIN
2630
+ products p2 ON p2.name = p1.name
2631
+ WHERE
2632
+ p1.category = 'Guitar' AND
2633
+ p1.name = 'Test'
2634
+
2635
+  (0.1ms) DROP VIEW IF EXISTS amps
2636
+  (3.5ms) CREATE MATERIALIZED VIEW amps AS
2637
+ SELECT
2638
+ products.*
2639
+ FROM
2640
+ products
2641
+ WHERE
2642
+ products.category = 'Amps'
2643
+
2644
+  (2.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
2645
+  (0.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2646
+  (0.3ms) SELECT version FROM "schema_migrations"
2647
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20161125151801')
2648
+  (0.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20161017172847')
2649
+  (0.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20161125151623')
2650
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
2651
+  (2.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
2652
+ FROM pg_constraint c
2653
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2654
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2655
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2656
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2657
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2658
+ WHERE c.contype = 'f'
2659
+ AND t1.relname = 'products'
2660
+ AND t3.nspname = ANY (current_schemas(false))
2661
+ ORDER BY c.conname
2662
+
2663
+  (0.4ms)  SELECT c.relname as name, c.relkind AS type, c.oid
2664
+ FROM pg_class c
2665
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2666
+ WHERE c.relkind IN ('m', 'v')
2667
+ AND n.nspname = ANY (current_schemas(false))
2668
+ ORDER BY c.oid ASC
2669
+ 
2670
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
2671
+ Migrating to AddIndexToAmps (20161125192751)
2672
+  (0.1ms) BEGIN
2673
+  (12.2ms) CREATE INDEX "index_amps_on_name" ON "amps" ("name")
2674
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161125192751"]]
2675
+  (5.6ms) COMMIT
14
2676
  ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
15
-  (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
2677
+  (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
2678
+ FROM pg_constraint c
2679
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2680
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2681
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2682
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2683
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2684
+ WHERE c.contype = 'f'
2685
+ AND t1.relname = 'products'
2686
+ AND t3.nspname = ANY (current_schemas(false))
2687
+ ORDER BY c.conname
2688
+ 
2689
+  (0.9ms) SELECT c.relname as name, c.relkind AS type
2690
+ FROM pg_class c
2691
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2692
+ WHERE c.relkind IN ('m', 'v')
2693
+ AND n.nspname = ANY (current_schemas(false))
2694
+ ORDER BY c.oid ASC
2695
+
2696
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
2697
+  (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
2698
+ FROM pg_constraint c
2699
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2700
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2701
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2702
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2703
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2704
+ WHERE c.contype = 'f'
2705
+ AND t1.relname = 'products'
2706
+ AND t3.nspname = ANY (current_schemas(false))
2707
+ ORDER BY c.conname
2708
+
2709
+  (0.4ms)  SELECT c.relname as name, c.relkind AS type
2710
+ FROM pg_class c
2711
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2712
+ WHERE c.relkind IN ('m', 'v')
2713
+ AND n.nspname = ANY (current_schemas(false))
2714
+ ORDER BY c.oid ASC
2715
+ 
2716
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
2717
+  (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
16
2718
  FROM pg_constraint c
17
2719
  JOIN pg_class t1 ON c.conrelid = t1.oid
18
2720
  JOIN pg_class t2 ON c.confrelid = t2.oid
@@ -20,20 +2722,39 @@ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
20
2722
  JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
21
2723
  JOIN pg_namespace t3 ON c.connamespace = t3.oid
22
2724
  WHERE c.contype = 'f'
23
- AND t1.relname = 'users'
2725
+ AND t1.relname = 'products'
24
2726
  AND t3.nspname = ANY (current_schemas(false))
25
2727
  ORDER BY c.conname
2728
+
2729
+  (0.4ms)  SELECT c.relname as name, c.relkind AS type
2730
+ FROM pg_class c
2731
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2732
+ WHERE c.relkind IN ('m', 'v')
2733
+ AND n.nspname = ANY (current_schemas(false))
2734
+ ORDER BY c.oid ASC
26
2735
  
27
-  (2.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
28
-  (12.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2736
+  (15.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
2737
+  (14.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
29
2738
  ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
30
2739
  Migrating to CreateProducts (20161017172847)
31
-  (0.2ms) BEGIN
32
-  (7.4ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
2740
+  (0.1ms) BEGIN
2741
+  (12.7ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
33
2742
  SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161017172847"]]
34
-  (0.5ms) COMMIT
2743
+  (5.4ms) COMMIT
2744
+ Migrating to CreateGuitarsView (20161125151623)
2745
+  (5.4ms) BEGIN
2746
+  (1.6ms) CREATE VIEW guitars AS
2747
+ SELECT
2748
+ *
2749
+ FROM
2750
+ products
2751
+ WHERE
2752
+ category = 'Guitar'
2753
+ 
2754
+ SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161125151623"]]
2755
+  (5.9ms) COMMIT
35
2756
  ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
36
-  (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
2757
+  (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
37
2758
  FROM pg_constraint c
38
2759
  JOIN pg_class t1 ON c.conrelid = t1.oid
39
2760
  JOIN pg_class t2 ON c.confrelid = t2.oid
@@ -45,16 +2766,161 @@ WHERE c.contype = 'f'
45
2766
  AND t3.nspname = ANY (current_schemas(false))
46
2767
  ORDER BY c.conname
47
2768
  
48
-  (35.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
49
-  (12.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
50
- ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
2769
+  (0.5ms) SELECT c.relname as name, c.relkind AS type
2770
+ FROM pg_class c
2771
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2772
+ WHERE c.relkind IN ('v')
2773
+ AND n.nspname = ANY (current_schemas(false))
2774
+ ORDER BY c.oid ASC
2775
+
2776
+  (2.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
2777
+  (14.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2778
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
51
2779
  Migrating to CreateProducts (20161017172847)
2780
+  (0.1ms) BEGIN
2781
+  (12.9ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
2782
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161017172847"]]
2783
+  (5.6ms) COMMIT
2784
+ Migrating to CreateGuitarsView (20161125151623)
2785
+  (5.5ms) BEGIN
2786
+  (1.9ms) CREATE VIEW guitars AS
2787
+ SELECT
2788
+ *
2789
+ FROM
2790
+ products
2791
+ WHERE
2792
+ category = 'Guitar'
2793
+ 
2794
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161125151623"]]
2795
+  (5.5ms) COMMIT
2796
+ Migrating to ChangeGuitarsView (20161126212242)
52
2797
   (0.2ms) BEGIN
53
-  (29.1ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
54
- SQL (0.6ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161017172847"]]
55
-  (6.1ms) COMMIT
2798
+  (13.0ms) DROP VIEW guitars
2799
+  (0.7ms) CREATE VIEW guitars AS
2800
+ SELECT
2801
+ *
2802
+ FROM
2803
+ products
2804
+ WHERE
2805
+ category = 'Guitar'
2806
+
2807
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161126212242"]]
2808
+  (5.5ms) COMMIT
2809
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
2810
+  (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
2811
+ FROM pg_constraint c
2812
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2813
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2814
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2815
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2816
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2817
+ WHERE c.contype = 'f'
2818
+ AND t1.relname = 'products'
2819
+ AND t3.nspname = ANY (current_schemas(false))
2820
+ ORDER BY c.conname
2821
+
2822
+  (0.6ms)  SELECT c.relname as name, c.relkind AS type
2823
+ FROM pg_class c
2824
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2825
+ WHERE c.relkind IN ('v')
2826
+ AND n.nspname = ANY (current_schemas(false))
2827
+ ORDER BY c.oid ASC
2828
+ 
2829
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
2830
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
2831
+  (2.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
2832
+ FROM pg_constraint c
2833
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2834
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2835
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2836
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2837
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2838
+ WHERE c.contype = 'f'
2839
+ AND t1.relname = 'products'
2840
+ AND t3.nspname = ANY (current_schemas(false))
2841
+ ORDER BY c.conname
2842
+ 
2843
+  (0.4ms) SELECT c.relname as name, c.relkind AS type
2844
+ FROM pg_class c
2845
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2846
+ WHERE c.relkind IN ('v')
2847
+ AND n.nspname = ANY (current_schemas(false))
2848
+ ORDER BY c.oid ASC
2849
+
2850
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
2851
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
2852
+  (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
2853
+ FROM pg_constraint c
2854
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2855
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2856
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2857
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2858
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2859
+ WHERE c.contype = 'f'
2860
+ AND t1.relname = 'products'
2861
+ AND t3.nspname = ANY (current_schemas(false))
2862
+ ORDER BY c.conname
2863
+ 
2864
+  (0.5ms) SELECT c.relname as name, c.relkind AS type
2865
+ FROM pg_class c
2866
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2867
+ WHERE c.relkind IN ('v')
2868
+ AND n.nspname = ANY (current_schemas(false))
2869
+ ORDER BY c.oid ASC
2870
+
2871
+ SQL (1.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2872
+  (8.0ms) DROP TABLE "products" CASCADE
2873
+  (5.3ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
2874
+  (0.3ms) DROP VIEW IF EXISTS guitars
2875
+  (6.5ms) CREATE VIEW guitars AS
2876
+ SELECT
2877
+ *
2878
+ FROM
2879
+ products
2880
+ WHERE
2881
+ category = 'Guitar'
2882
+ 
2883
+  (0.9ms) SELECT version FROM "schema_migrations"
2884
+ SQL (0.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2885
+  (5.9ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
2886
+  (0.2ms) DROP VIEW IF EXISTS guitars
2887
+  (1.4ms) CREATE VIEW guitars AS
2888
+ SELECT
2889
+ *
2890
+ FROM
2891
+ products
2892
+ WHERE
2893
+ category = 'Guitar'
2894
+
2895
+  (1.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
2896
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2897
+  (0.5ms) SELECT version FROM "schema_migrations"
2898
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20161126212242')
2899
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20161017172847')
2900
+  (0.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20161125151623')
2901
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
2902
+  (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
2903
+ FROM pg_constraint c
2904
+ JOIN pg_class t1 ON c.conrelid = t1.oid
2905
+ JOIN pg_class t2 ON c.confrelid = t2.oid
2906
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
2907
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
2908
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
2909
+ WHERE c.contype = 'f'
2910
+ AND t1.relname = 'products'
2911
+ AND t3.nspname = ANY (current_schemas(false))
2912
+ ORDER BY c.conname
2913
+
2914
+  (0.4ms)  SELECT c.relname as name, c.relkind AS type
2915
+ FROM pg_class c
2916
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2917
+ WHERE c.relkind IN ('v')
2918
+ AND n.nspname = ANY (current_schemas(false))
2919
+ ORDER BY c.oid ASC
2920
+ 
2921
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
56
2922
  ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
57
-  (11.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
2923
+  (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
58
2924
  FROM pg_constraint c
59
2925
  JOIN pg_class t1 ON c.conrelid = t1.oid
60
2926
  JOIN pg_class t2 ON c.confrelid = t2.oid
@@ -66,3 +2932,10 @@ WHERE c.contype = 'f'
66
2932
  AND t3.nspname = ANY (current_schemas(false))
67
2933
  ORDER BY c.conname
68
2934
  
2935
+  (0.4ms) SELECT c.relname as name, c.relkind AS type
2936
+ FROM pg_class c
2937
+ LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
2938
+ WHERE c.relkind IN ('v')
2939
+ AND n.nspname = ANY (current_schemas(false))
2940
+ ORDER BY c.oid ASC
2941
+