· 7 years ago · Sep 25, 2018, 02:56 PM
1harrys-macbook:motorway-platform harryjones$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U motorway -d motorway_dev latest.dump
2pg_restore: connecting to database for restore
3pg_restore: dropping FK CONSTRAINT vehicles vehicles_makeId_fkey
4pg_restore: dropping FK CONSTRAINT valuations valuations_partnerId_fkey
5pg_restore: [archiver (db)] Error while PROCESSING TOC:
6pg_restore: [archiver (db)] Error from TOC entry 3464; 2606 16789 FK CONSTRAINT valuations valuations_partnerId_fkey u6hvindjrfu37i
7pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.valuations" does not exist
8 Command was: ALTER TABLE ONLY "public"."valuations" DROP CONSTRAINT "valuations_partnerId_fkey";
9
10pg_restore: dropping FK CONSTRAINT valuations valuations_enquiryId_fkey
11pg_restore: [archiver (db)] Error from TOC entry 3463; 2606 16784 FK CONSTRAINT valuations valuations_enquiryId_fkey u6hvindjrfu37i
12pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.valuations" does not exist
13 Command was: ALTER TABLE ONLY "public"."valuations" DROP CONSTRAINT "valuations_enquiryId_fkey";
14
15pg_restore: dropping FK CONSTRAINT valuation_states valuation_states_valuationId_fkey
16pg_restore: [archiver (db)] Error from TOC entry 3462; 2606 405196 FK CONSTRAINT valuation_states valuation_states_valuationId_fkey u6hvindjrfu37i
17pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.valuation_states" does not exist
18 Command was: ALTER TABLE ONLY "public"."valuation_states" DROP CONSTRAINT "valuation_states_valuationId_fkey";
19
20pg_restore: dropping FK CONSTRAINT enquiries enquiries_vehicleId_fkey
21pg_restore: [archiver (db)] Error from TOC entry 3461; 2606 16774 FK CONSTRAINT enquiries enquiries_vehicleId_fkey u6hvindjrfu37i
22pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.enquiries" does not exist
23 Command was: ALTER TABLE ONLY "public"."enquiries" DROP CONSTRAINT "enquiries_vehicleId_fkey";
24
25pg_restore: dropping FK CONSTRAINT enquiries enquiries_customerId_fkey
26pg_restore: [archiver (db)] Error from TOC entry 3460; 2606 16769 FK CONSTRAINT enquiries enquiries_customerId_fkey u6hvindjrfu37i
27pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.enquiries" does not exist
28 Command was: ALTER TABLE ONLY "public"."enquiries" DROP CONSTRAINT "enquiries_customerId_fkey";
29
30pg_restore: dropping FK CONSTRAINT customer_feedback customer_feedback_partnerId_fkey
31pg_restore: [archiver (db)] Error from TOC entry 3467; 2606 326930 FK CONSTRAINT customer_feedback customer_feedback_partnerId_fkey u6hvindjrfu37i
32pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.customer_feedback" does not exist
33 Command was: ALTER TABLE ONLY "public"."customer_feedback" DROP CONSTRAINT "customer_feedback_partnerId_fkey";
34
35pg_restore: dropping FK CONSTRAINT customer_feedback customer_feedback_enquiryId_fkey
36pg_restore: [archiver (db)] Error from TOC entry 3466; 2606 299265 FK CONSTRAINT customer_feedback customer_feedback_enquiryId_fkey u6hvindjrfu37i
37pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.customer_feedback" does not exist
38 Command was: ALTER TABLE ONLY "public"."customer_feedback" DROP CONSTRAINT "customer_feedback_enquiryId_fkey";
39
40pg_restore: dropping FK CONSTRAINT branches branches_partnerId_fkey
41pg_restore: [archiver (db)] Error from TOC entry 3459; 2606 16764 FK CONSTRAINT branches branches_partnerId_fkey u6hvindjrfu37i
42pg_restore: [archiver (db)] could not execute query: ERROR: constraint "branches_partnerId_fkey" of relation "branches" does not exist
43 Command was: ALTER TABLE ONLY "public"."branches" DROP CONSTRAINT "branches_partnerId_fkey";
44
45pg_restore: dropping FK CONSTRAINT branch_postcodes branch_postcodes_postcodeId_fkey
46pg_restore: dropping FK CONSTRAINT branch_postcodes branch_postcodes_branchId_fkey
47pg_restore: dropping TRIGGER eligibility_rules updated_rules_trigger
48pg_restore: [archiver (db)] Error from TOC entry 3469; 2620 176548 TRIGGER eligibility_rules updated_rules_trigger u6hvindjrfu37i
49pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.eligibility_rules" does not exist
50 Command was: DROP TRIGGER "updated_rules_trigger" ON "public"."eligibility_rules";
51
52pg_restore: dropping TRIGGER buyers updated_partners_trigger
53pg_restore: [archiver (db)] Error from TOC entry 3468; 2620 94695 TRIGGER buyers updated_partners_trigger u6hvindjrfu37i
54pg_restore: [archiver (db)] could not execute query: ERROR: trigger "updated_partners_trigger" for table "buyers" does not exist
55 Command was: DROP TRIGGER "updated_partners_trigger" ON "public"."buyers";
56
57pg_restore: dropping INDEX valuation_status_histories_valuationid
58pg_restore: [archiver (db)] Error from TOC entry 3433; 1259 23435 INDEX valuation_status_histories_valuationid u6hvindjrfu37i
59pg_restore: [archiver (db)] could not execute query: ERROR: index "valuation_status_histories_valuationid" does not exist
60 Command was: DROP INDEX "public"."valuation_status_histories_valuationid";
61
62pg_restore: dropping INDEX gov_models_make_id_name
63pg_restore: [archiver (db)] Error from TOC entry 3446; 1259 98602 INDEX gov_models_make_id_name u6hvindjrfu37i
64pg_restore: [archiver (db)] could not execute query: ERROR: index "gov_models_make_id_name" does not exist
65 Command was: DROP INDEX "public"."gov_models_make_id_name";
66
67pg_restore: dropping INDEX customers_login_token
68pg_restore: [archiver (db)] Error from TOC entry 3414; 1259 397530 INDEX customers_login_token u6hvindjrfu37i
69pg_restore: [archiver (db)] could not execute query: ERROR: index "customers_login_token" does not exist
70 Command was: DROP INDEX "public"."customers_login_token";
71
72pg_restore: dropping CONSTRAINT vehicles vehicles_pkey
73pg_restore: dropping CONSTRAINT valuations valuations_pkey
74pg_restore: [archiver (db)] Error from TOC entry 3435; 2606 16751 CONSTRAINT valuations valuations_pkey u6hvindjrfu37i
75pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.valuations" does not exist
76 Command was: ALTER TABLE ONLY "public"."valuations" DROP CONSTRAINT "valuations_pkey";
77
78pg_restore: dropping CONSTRAINT valuation_states valuation_status_histories_pkey
79pg_restore: [archiver (db)] Error from TOC entry 3432; 2606 16749 CONSTRAINT valuation_states valuation_status_histories_pkey u6hvindjrfu37i
80pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.valuation_states" does not exist
81 Command was: ALTER TABLE ONLY "public"."valuation_states" DROP CONSTRAINT "valuation_status_histories_pkey";
82
83pg_restore: dropping CONSTRAINT sales_data sales_data_pkey
84pg_restore: [archiver (db)] Error from TOC entry 3456; 2606 512717 CONSTRAINT sales_data sales_data_pkey u6hvindjrfu37i
85pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.sales_data" does not exist
86 Command was: ALTER TABLE ONLY "public"."sales_data" DROP CONSTRAINT "sales_data_pkey";
87
88pg_restore: dropping CONSTRAINT postcodes postcodes_value_key
89pg_restore: [archiver (db)] Error from TOC entry 3430; 2606 16747 CONSTRAINT postcodes postcodes_value_key u6hvindjrfu37i
90pg_restore: [archiver (db)] could not execute query: ERROR: cannot drop constraint postcodes_value_key on table public.postcodes because other objects depend on it
91DETAIL: constraint customers_postcode_fkey on table public.customers depends on index public.postcodes_value_key
92HINT: Use DROP ... CASCADE to drop the dependent objects too.
93 Command was: ALTER TABLE ONLY "public"."postcodes" DROP CONSTRAINT "postcodes_value_key";
94
95pg_restore: dropping CONSTRAINT postcodes postcodes_pkey
96pg_restore: dropping CONSTRAINT buyers partners_slug_key
97pg_restore: [archiver (db)] Error from TOC entry 3426; 2606 16743 CONSTRAINT buyers partners_slug_key u6hvindjrfu37i
98pg_restore: [archiver (db)] could not execute query: ERROR: constraint "partners_slug_key" of relation "buyers" does not exist
99 Command was: ALTER TABLE ONLY "public"."buyers" DROP CONSTRAINT "partners_slug_key";
100
101pg_restore: dropping CONSTRAINT buyers partners_pkey
102pg_restore: [archiver (db)] Error from TOC entry 3424; 2606 16741 CONSTRAINT buyers partners_pkey u6hvindjrfu37i
103pg_restore: [archiver (db)] could not execute query: ERROR: constraint "partners_pkey" of relation "buyers" does not exist
104 Command was: ALTER TABLE ONLY "public"."buyers" DROP CONSTRAINT "partners_pkey";
105
106pg_restore: dropping CONSTRAINT makes makes_pkey
107pg_restore: [archiver (db)] Error from TOC entry 3422; 2606 16739 CONSTRAINT makes makes_pkey u6hvindjrfu37i
108pg_restore: [archiver (db)] could not execute query: ERROR: cannot drop constraint makes_pkey on table public.makes because other objects depend on it
109DETAIL: constraint models_makeId_fkey on table public.models depends on index public.makes_pkey
110HINT: Use DROP ... CASCADE to drop the dependent objects too.
111 Command was: ALTER TABLE ONLY "public"."makes" DROP CONSTRAINT "makes_pkey";
112
113pg_restore: dropping CONSTRAINT makes makes_map_id_key
114pg_restore: dropping CONSTRAINT model_variants gov_models_pkey
115pg_restore: [archiver (db)] Error from TOC entry 3448; 2606 98533 CONSTRAINT model_variants gov_models_pkey u6hvindjrfu37i
116pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.model_variants" does not exist
117 Command was: ALTER TABLE ONLY "public"."model_variants" DROP CONSTRAINT "gov_models_pkey";
118
119pg_restore: dropping CONSTRAINT models gen_models_pkey
120pg_restore: [archiver (db)] Error from TOC entry 3445; 2606 98525 CONSTRAINT models gen_models_pkey u6hvindjrfu37i
121pg_restore: [archiver (db)] could not execute query: ERROR: constraint "gen_models_pkey" of relation "models" does not exist
122 Command was: ALTER TABLE ONLY "public"."models" DROP CONSTRAINT "gen_models_pkey";
123
124pg_restore: dropping CONSTRAINT enquiries enquiries_pkey
125pg_restore: [archiver (db)] Error from TOC entry 3418; 2606 16735 CONSTRAINT enquiries enquiries_pkey u6hvindjrfu37i
126pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.enquiries" does not exist
127 Command was: ALTER TABLE ONLY "public"."enquiries" DROP CONSTRAINT "enquiries_pkey";
128
129pg_restore: dropping CONSTRAINT eligibility_rules eligibility_rules_pkey
130pg_restore: [archiver (db)] Error from TOC entry 3450; 2606 171576 CONSTRAINT eligibility_rules eligibility_rules_pkey u6hvindjrfu37i
131pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.eligibility_rules" does not exist
132 Command was: ALTER TABLE ONLY "public"."eligibility_rules" DROP CONSTRAINT "eligibility_rules_pkey";
133
134pg_restore: dropping CONSTRAINT eligibilities eligibilities_pkey
135pg_restore: [archiver (db)] Error from TOC entry 3452; 2606 171584 CONSTRAINT eligibilities eligibilities_pkey u6hvindjrfu37i
136pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.eligibilities" does not exist
137 Command was: ALTER TABLE ONLY "public"."eligibilities" DROP CONSTRAINT "eligibilities_pkey";
138
139pg_restore: dropping CONSTRAINT customers customers_pkey
140pg_restore: dropping CONSTRAINT customer_feedback customer_feedback_pkey
141pg_restore: [archiver (db)] Error from TOC entry 3454; 2606 299264 CONSTRAINT customer_feedback customer_feedback_pkey u6hvindjrfu37i
142pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.customer_feedback" does not exist
143 Command was: ALTER TABLE ONLY "public"."customer_feedback" DROP CONSTRAINT "customer_feedback_pkey";
144
145pg_restore: dropping CONSTRAINT customers customer_email_key
146pg_restore: [archiver (db)] Error from TOC entry 3413; 2606 16731 CONSTRAINT customers customer_email_key u6hvindjrfu37i
147pg_restore: [archiver (db)] could not execute query: ERROR: constraint "customer_email_key" of relation "customers" does not exist
148 Command was: ALTER TABLE ONLY "public"."customers" DROP CONSTRAINT "customer_email_key";
149
150pg_restore: dropping CONSTRAINT branches branches_pkey
151pg_restore: dropping CONSTRAINT branch_postcodes branch_postcodes_pkey
152pg_restore: dropping CONSTRAINT affiliates affiliates_slug_key
153pg_restore: dropping CONSTRAINT affiliates affiliates_pkey
154pg_restore: dropping CONSTRAINT SequelizeMeta SequelizeMeta_pkey
155pg_restore: dropping SEQUENCE SET vehicles_id_seq
156pg_restore: dropping TABLE DATA vehicles
157pg_restore: dropping SEQUENCE SET valuations_id_seq
158pg_restore: dropping TABLE DATA valuations
159pg_restore: dropping SEQUENCE SET valuation_status_histories_id_seq
160pg_restore: dropping TABLE DATA valuation_states
161pg_restore: dropping TABLE DATA tracking_data
162pg_restore: dropping TABLE DATA sales_data
163pg_restore: dropping SEQUENCE SET postcodes_id_seq
164pg_restore: dropping TABLE DATA postcodes
165pg_restore: dropping SEQUENCE SET partners_id_seq
166pg_restore: dropping TABLE DATA models
167pg_restore: dropping TABLE DATA model_variants
168pg_restore: dropping SEQUENCE SET makes_id_seq
169pg_restore: dropping TABLE DATA makes
170pg_restore: dropping SEQUENCE SET gov_models_id_seq
171pg_restore: dropping SEQUENCE SET gen_models_id_seq
172pg_restore: dropping SEQUENCE SET enquiries_id_seq
173pg_restore: dropping TABLE DATA enquiries
174pg_restore: dropping SEQUENCE SET eligibility_rules_id_seq
175pg_restore: dropping TABLE DATA eligibility_rules
176pg_restore: dropping SEQUENCE SET eligibilities_id_seq
177pg_restore: dropping TABLE DATA eligibilities
178pg_restore: dropping SEQUENCE SET customers_id_seq
179pg_restore: dropping TABLE DATA customers
180pg_restore: dropping TABLE DATA customer_feedback
181pg_restore: dropping TABLE DATA buyers
182pg_restore: dropping SEQUENCE SET branches_id_seq
183pg_restore: dropping TABLE DATA branches
184pg_restore: dropping TABLE DATA branch_postcodes
185pg_restore: dropping SEQUENCE SET affiliates_id_seq
186pg_restore: dropping TABLE DATA affiliates
187pg_restore: dropping TABLE DATA SequelizeMeta
188pg_restore: dropping DEFAULT models id
189pg_restore: dropping DEFAULT model_variants id
190pg_restore: [archiver (db)] Error from TOC entry 3405; 2604 98531 DEFAULT model_variants id u6hvindjrfu37i
191pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.model_variants" does not exist
192 Command was: ALTER TABLE "public"."model_variants" ALTER COLUMN "id" DROP DEFAULT;
193
194pg_restore: dropping DEFAULT eligibility_rules id
195pg_restore: [archiver (db)] Error from TOC entry 3406; 2604 171571 DEFAULT eligibility_rules id u6hvindjrfu37i
196pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.eligibility_rules" does not exist
197 Command was: ALTER TABLE "public"."eligibility_rules" ALTER COLUMN "id" DROP DEFAULT;
198
199pg_restore: dropping DEFAULT eligibilities id
200pg_restore: [archiver (db)] Error from TOC entry 3407; 2604 171582 DEFAULT eligibilities id u6hvindjrfu37i
201pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.eligibilities" does not exist
202 Command was: ALTER TABLE "public"."eligibilities" ALTER COLUMN "id" DROP DEFAULT;
203
204pg_restore: dropping DEFAULT affiliates id
205pg_restore: dropping VIEW tcbg_passive
206pg_restore: [archiver (db)] Error from TOC entry 330; 1259 634758 VIEW tcbg_passive u6hvindjrfu37i
207pg_restore: [archiver (db)] could not execute query: ERROR: view "tcbg_passive" does not exist
208 Command was: DROP VIEW "public"."tcbg_passive";
209
210pg_restore: dropping TABLE sales_data
211pg_restore: [archiver (db)] Error from TOC entry 329; 1259 512713 TABLE sales_data u6hvindjrfu37i
212pg_restore: [archiver (db)] could not execute query: ERROR: table "sales_data" does not exist
213 Command was: DROP TABLE "public"."sales_data";
214
215pg_restore: dropping TABLE postcodes
216pg_restore: [archiver (db)] Error from TOC entry 303; 1259 16680 TABLE postcodes u6hvindjrfu37i
217pg_restore: [archiver (db)] could not execute query: ERROR: cannot drop table public.postcodes because other objects depend on it
218DETAIL: constraint customers_postcode_fkey on table public.customers depends on table public.postcodes
219HINT: Use DROP ... CASCADE to drop the dependent objects too.
220 Command was: DROP TABLE "public"."postcodes";
221
222pg_restore: dropping SEQUENCE postcodes_id_seq
223pg_restore: [archiver (db)] Error from TOC entry 302; 1259 16678 SEQUENCE postcodes_id_seq u6hvindjrfu37i
224pg_restore: [archiver (db)] could not execute query: ERROR: cannot drop sequence public.postcodes_id_seq because other objects depend on it
225DETAIL: default for table public.postcodes column id depends on sequence public.postcodes_id_seq
226HINT: Use DROP ... CASCADE to drop the dependent objects too.
227 Command was: DROP SEQUENCE "public"."postcodes_id_seq";
228
229pg_restore: dropping VIEW partner_performance
230pg_restore: [archiver (db)] Error from TOC entry 332; 1259 678233 VIEW partner_performance u6hvindjrfu37i
231pg_restore: [archiver (db)] could not execute query: ERROR: view "partner_performance" does not exist
232 Command was: DROP VIEW "public"."partner_performance";
233
234pg_restore: dropping VIEW hello
235pg_restore: [archiver (db)] Error from TOC entry 326; 1259 432448 VIEW hello u6hvindjrfu37i
236pg_restore: [archiver (db)] could not execute query: ERROR: view "hello" does not exist
237 Command was: DROP VIEW "public"."hello";
238
239pg_restore: dropping SEQUENCE OWNED BY gov_models_id_seq
240pg_restore: dropping SEQUENCE gov_models_id_seq
241pg_restore: [archiver (db)] Error from TOC entry 315; 1259 98526 SEQUENCE gov_models_id_seq u6hvindjrfu37i
242pg_restore: [archiver (db)] could not execute query: ERROR: sequence "gov_models_id_seq" does not exist
243 Command was: DROP SEQUENCE "public"."gov_models_id_seq";
244
245pg_restore: dropping TABLE model_variants
246pg_restore: [archiver (db)] Error from TOC entry 316; 1259 98528 TABLE model_variants u6hvindjrfu37i
247pg_restore: [archiver (db)] could not execute query: ERROR: table "model_variants" does not exist
248 Command was: DROP TABLE "public"."model_variants";
249
250pg_restore: dropping VIEW gig_performance
251pg_restore: [archiver (db)] Error from TOC entry 331; 1259 635582 VIEW gig_performance u6hvindjrfu37i
252pg_restore: [archiver (db)] could not execute query: ERROR: view "gig_performance" does not exist
253 Command was: DROP VIEW "public"."gig_performance";
254
255pg_restore: dropping SEQUENCE OWNED BY gen_models_id_seq
256pg_restore: dropping SEQUENCE gen_models_id_seq
257pg_restore: [archiver (db)] Error from TOC entry 313; 1259 98518 SEQUENCE gen_models_id_seq u6hvindjrfu37i
258pg_restore: [archiver (db)] could not execute query: ERROR: sequence "gen_models_id_seq" does not exist
259 Command was: DROP SEQUENCE "public"."gen_models_id_seq";
260
261pg_restore: dropping VIEW enquiry_day
262pg_restore: [archiver (db)] Error from TOC entry 328; 1259 489139 VIEW enquiry_day u6hvindjrfu37i
263pg_restore: [archiver (db)] could not execute query: ERROR: view "enquiry_day" does not exist
264 Command was: DROP VIEW "public"."enquiry_day";
265
266pg_restore: dropping SEQUENCE OWNED BY eligibility_rules_id_seq
267pg_restore: dropping SEQUENCE eligibility_rules_id_seq
268pg_restore: [archiver (db)] Error from TOC entry 320; 1259 171566 SEQUENCE eligibility_rules_id_seq u6hvindjrfu37i
269pg_restore: [archiver (db)] could not execute query: ERROR: sequence "eligibility_rules_id_seq" does not exist
270 Command was: DROP SEQUENCE "public"."eligibility_rules_id_seq";
271
272pg_restore: dropping TABLE eligibility_rules
273pg_restore: [archiver (db)] Error from TOC entry 321; 1259 171568 TABLE eligibility_rules u6hvindjrfu37i
274pg_restore: [archiver (db)] could not execute query: ERROR: table "eligibility_rules" does not exist
275 Command was: DROP TABLE "public"."eligibility_rules";
276
277pg_restore: dropping SEQUENCE OWNED BY eligibilities_id_seq
278pg_restore: dropping SEQUENCE eligibilities_id_seq
279pg_restore: [archiver (db)] Error from TOC entry 322; 1259 171577 SEQUENCE eligibilities_id_seq u6hvindjrfu37i
280pg_restore: [archiver (db)] could not execute query: ERROR: sequence "eligibilities_id_seq" does not exist
281 Command was: DROP SEQUENCE "public"."eligibilities_id_seq";
282
283pg_restore: dropping TABLE eligibilities
284pg_restore: [archiver (db)] Error from TOC entry 323; 1259 171579 TABLE eligibilities u6hvindjrfu37i
285pg_restore: [archiver (db)] could not execute query: ERROR: table "eligibilities" does not exist
286 Command was: DROP TABLE "public"."eligibilities";
287
288pg_restore: dropping VIEW daily_enquiry
289pg_restore: [archiver (db)] Error from TOC entry 327; 1259 478582 VIEW daily_enquiry u6hvindjrfu37i
290pg_restore: [archiver (db)] could not execute query: ERROR: view "daily_enquiry" does not exist
291 Command was: DROP VIEW "public"."daily_enquiry";
292
293pg_restore: dropping TABLE vehicles
294pg_restore: dropping SEQUENCE vehicles_id_seq
295pg_restore: [archiver (db)] Error from TOC entry 308; 1259 16705 SEQUENCE vehicles_id_seq u6hvindjrfu37i
296pg_restore: [archiver (db)] could not execute query: ERROR: sequence "vehicles_id_seq" does not exist
297 Command was: DROP SEQUENCE "public"."vehicles_id_seq";
298
299pg_restore: dropping TABLE valuations
300pg_restore: [archiver (db)] Error from TOC entry 307; 1259 16692 TABLE valuations u6hvindjrfu37i
301pg_restore: [archiver (db)] could not execute query: ERROR: table "valuations" does not exist
302 Command was: DROP TABLE "public"."valuations";
303
304pg_restore: dropping SEQUENCE valuations_id_seq
305pg_restore: [archiver (db)] Error from TOC entry 306; 1259 16690 SEQUENCE valuations_id_seq u6hvindjrfu37i
306pg_restore: [archiver (db)] could not execute query: ERROR: sequence "valuations_id_seq" does not exist
307 Command was: DROP SEQUENCE "public"."valuations_id_seq";
308
309pg_restore: dropping TABLE valuation_states
310pg_restore: [archiver (db)] Error from TOC entry 305; 1259 16686 TABLE valuation_states u6hvindjrfu37i
311pg_restore: [archiver (db)] could not execute query: ERROR: table "valuation_states" does not exist
312 Command was: DROP TABLE "public"."valuation_states";
313
314pg_restore: dropping SEQUENCE valuation_status_histories_id_seq
315pg_restore: [archiver (db)] Error from TOC entry 304; 1259 16684 SEQUENCE valuation_status_histories_id_seq u6hvindjrfu37i
316pg_restore: [archiver (db)] could not execute query: ERROR: cannot drop sequence public.valuation_status_histories_id_seq because other objects depend on it
317DETAIL: default for table public.valuation_status_histories column id depends on sequence public.valuation_status_histories_id_seq
318HINT: Use DROP ... CASCADE to drop the dependent objects too.
319 Command was: DROP SEQUENCE "public"."valuation_status_histories_id_seq";
320
321pg_restore: dropping TABLE tracking_data
322pg_restore: [archiver (db)] Error from TOC entry 325; 1259 326924 TABLE tracking_data u6hvindjrfu37i
323pg_restore: [archiver (db)] could not execute query: ERROR: table "tracking_data" does not exist
324 Command was: DROP TABLE "public"."tracking_data";
325
326pg_restore: dropping TABLE models
327pg_restore: dropping TABLE makes
328pg_restore: dropping SEQUENCE makes_id_seq
329pg_restore: [archiver (db)] Error from TOC entry 298; 1259 16659 SEQUENCE makes_id_seq u6hvindjrfu37i
330pg_restore: [archiver (db)] could not execute query: ERROR: sequence "makes_id_seq" does not exist
331 Command was: DROP SEQUENCE "public"."makes_id_seq";
332
333pg_restore: dropping TABLE enquiries
334pg_restore: [archiver (db)] Error from TOC entry 297; 1259 16652 TABLE enquiries u6hvindjrfu37i
335pg_restore: [archiver (db)] could not execute query: ERROR: table "enquiries" does not exist
336 Command was: DROP TABLE "public"."enquiries";
337
338pg_restore: dropping SEQUENCE enquiries_id_seq
339pg_restore: [archiver (db)] Error from TOC entry 296; 1259 16650 SEQUENCE enquiries_id_seq u6hvindjrfu37i
340pg_restore: [archiver (db)] could not execute query: ERROR: sequence "enquiries_id_seq" does not exist
341 Command was: DROP SEQUENCE "public"."enquiries_id_seq";
342
343pg_restore: dropping TABLE customers
344pg_restore: dropping SEQUENCE customers_id_seq
345pg_restore: [archiver (db)] Error from TOC entry 294; 1259 16641 SEQUENCE customers_id_seq u6hvindjrfu37i
346pg_restore: [archiver (db)] could not execute query: ERROR: sequence "customers_id_seq" does not exist
347 Command was: DROP SEQUENCE "public"."customers_id_seq";
348
349pg_restore: dropping TABLE customer_feedback
350pg_restore: [archiver (db)] Error from TOC entry 324; 1259 299257 TABLE customer_feedback u6hvindjrfu37i
351pg_restore: [archiver (db)] could not execute query: ERROR: table "customer_feedback" does not exist
352 Command was: DROP TABLE "public"."customer_feedback";
353
354pg_restore: dropping TABLE buyers
355pg_restore: [archiver (db)] Error from TOC entry 301; 1259 16671 TABLE buyers u6hvindjrfu37i
356pg_restore: [archiver (db)] could not execute query: ERROR: cannot drop table public.buyers because other objects depend on it
357DETAIL: constraint branches_buyerId_fkey on table public.branches depends on table public.buyers
358HINT: Use DROP ... CASCADE to drop the dependent objects too.
359 Command was: DROP TABLE "public"."buyers";
360
361pg_restore: dropping SEQUENCE partners_id_seq
362pg_restore: [archiver (db)] Error from TOC entry 300; 1259 16669 SEQUENCE partners_id_seq u6hvindjrfu37i
363pg_restore: [archiver (db)] could not execute query: ERROR: sequence "partners_id_seq" does not exist
364 Command was: DROP SEQUENCE "public"."partners_id_seq";
365
366pg_restore: dropping TABLE branches
367pg_restore: dropping SEQUENCE branches_id_seq
368pg_restore: [archiver (db)] Error from TOC entry 292; 1259 16629 SEQUENCE branches_id_seq u6hvindjrfu37i
369pg_restore: [archiver (db)] could not execute query: ERROR: sequence "branches_id_seq" does not exist
370 Command was: DROP SEQUENCE "public"."branches_id_seq";
371
372pg_restore: dropping TABLE branch_postcodes
373pg_restore: dropping SEQUENCE OWNED BY affiliates_id_seq
374pg_restore: dropping SEQUENCE affiliates_id_seq
375pg_restore: dropping TABLE affiliates
376pg_restore: dropping TABLE SequelizeMeta
377pg_restore: dropping FUNCTION rules_notify()
378pg_restore: [archiver (db)] Error from TOC entry 397; 1255 176547 FUNCTION rules_notify() u6hvindjrfu37i
379pg_restore: [archiver (db)] could not execute query: ERROR: function public.rules_notify() does not exist
380 Command was: DROP FUNCTION "public"."rules_notify"();
381
382pg_restore: dropping FUNCTION partners_notify()
383pg_restore: dropping TYPE enum_enquiries_valuation_reason
384pg_restore: dropping TYPE enum_enquiries_new_car_status
385pg_restore: dropping TYPE enum_customer_feedback_rejection_reason
386pg_restore: [archiver (db)] Error from TOC entry 972; 1247 299249 TYPE enum_customer_feedback_rejection_reason u6hvindjrfu37i
387pg_restore: [archiver (db)] could not execute query: ERROR: type "public.enum_customer_feedback_rejection_reason" does not exist
388 Command was: DROP TYPE "public"."enum_customer_feedback_rejection_reason";
389
390pg_restore: dropping COMMENT EXTENSION "tablefunc"
391pg_restore: dropping EXTENSION tablefunc
392pg_restore: [archiver (db)] Error from TOC entry 5; 3079 113517 EXTENSION tablefunc
393pg_restore: [archiver (db)] could not execute query: ERROR: extension "tablefunc" does not exist
394 Command was: DROP EXTENSION "tablefunc";
395
396pg_restore: dropping COMMENT EXTENSION "pg_stat_statements"
397pg_restore: dropping EXTENSION pg_stat_statements
398pg_restore: [archiver (db)] Error from TOC entry 7; 3079 16400 EXTENSION pg_stat_statements
399pg_restore: [archiver (db)] could not execute query: ERROR: extension "pg_stat_statements" does not exist
400 Command was: DROP EXTENSION "pg_stat_statements";
401
402pg_restore: dropping COMMENT EXTENSION "hstore"
403pg_restore: dropping EXTENSION hstore
404pg_restore: [archiver (db)] Error from TOC entry 2; 3079 373288 EXTENSION hstore
405pg_restore: [archiver (db)] could not execute query: ERROR: extension "hstore" does not exist
406 Command was: DROP EXTENSION "hstore";
407
408pg_restore: dropping COMMENT EXTENSION "earthdistance"
409pg_restore: dropping EXTENSION earthdistance
410pg_restore: [archiver (db)] Error from TOC entry 3; 3079 213431 EXTENSION earthdistance
411pg_restore: [archiver (db)] could not execute query: ERROR: extension "earthdistance" does not exist
412 Command was: DROP EXTENSION "earthdistance";
413
414pg_restore: dropping COMMENT EXTENSION "dblink"
415pg_restore: dropping EXTENSION dblink
416pg_restore: [archiver (db)] Error from TOC entry 6; 3079 16580 EXTENSION dblink
417pg_restore: [archiver (db)] could not execute query: ERROR: extension "dblink" does not exist
418 Command was: DROP EXTENSION "dblink";
419
420pg_restore: dropping COMMENT EXTENSION "cube"
421pg_restore: dropping EXTENSION cube
422pg_restore: [archiver (db)] Error from TOC entry 4; 3079 213344 EXTENSION cube
423pg_restore: [archiver (db)] could not execute query: ERROR: extension "cube" does not exist
424 Command was: DROP EXTENSION "cube";
425
426pg_restore: dropping COMMENT EXTENSION "plpgsql"
427pg_restore: dropping EXTENSION plpgsql
428pg_restore: [archiver (db)] Error from TOC entry 1; 3079 16388 EXTENSION plpgsql
429pg_restore: [archiver (db)] could not execute query: ERROR: must be owner of extension plpgsql
430 Command was: DROP EXTENSION "plpgsql";
431
432pg_restore: dropping COMMENT SCHEMA "public"
433pg_restore: dropping SCHEMA public
434pg_restore: [archiver (db)] Error from TOC entry 111; 2615 2200 SCHEMA public u6hvindjrfu37i
435pg_restore: [archiver (db)] could not execute query: ERROR: must be owner of schema public
436 Command was: DROP SCHEMA "public";
437
438pg_restore: creating SCHEMA "public"
439pg_restore: [archiver (db)] could not execute query: ERROR: schema "public" already exists
440 Command was: CREATE SCHEMA public;
441
442
443
444pg_restore: creating COMMENT "SCHEMA "public""
445pg_restore: [archiver (db)] Error from TOC entry 3633; 0 0 COMMENT SCHEMA "public" u6hvindjrfu37i
446pg_restore: [archiver (db)] could not execute query: ERROR: must be owner of schema public
447 Command was: COMMENT ON SCHEMA "public" IS 'standard public schema';
448
449
450
451pg_restore: creating EXTENSION "plpgsql"
452pg_restore: creating COMMENT "EXTENSION "plpgsql""
453pg_restore: [archiver (db)] Error from TOC entry 3634; 0 0 COMMENT EXTENSION "plpgsql"
454pg_restore: [archiver (db)] could not execute query: ERROR: must be owner of extension plpgsql
455 Command was: COMMENT ON EXTENSION "plpgsql" IS 'PL/pgSQL procedural language';
456
457
458
459pg_restore: creating EXTENSION "cube"
460pg_restore: [archiver (db)] Error from TOC entry 4; 3079 213344 EXTENSION cube
461pg_restore: [archiver (db)] could not execute query: ERROR: permission denied to create extension "cube"
462HINT: Must be superuser to create this extension.
463 Command was: CREATE EXTENSION IF NOT EXISTS "cube" WITH SCHEMA "public";
464
465
466
467pg_restore: creating COMMENT "EXTENSION "cube""
468pg_restore: [archiver (db)] Error from TOC entry 3635; 0 0 COMMENT EXTENSION "cube"
469pg_restore: [archiver (db)] could not execute query: ERROR: extension "cube" does not exist
470 Command was: COMMENT ON EXTENSION "cube" IS 'data type for multidimensional cubes';
471
472
473
474pg_restore: creating EXTENSION "dblink"
475pg_restore: [archiver (db)] Error from TOC entry 6; 3079 16580 EXTENSION dblink
476pg_restore: [archiver (db)] could not execute query: ERROR: permission denied to create extension "dblink"
477HINT: Must be superuser to create this extension.
478 Command was: CREATE EXTENSION IF NOT EXISTS "dblink" WITH SCHEMA "public";
479
480
481
482pg_restore: creating COMMENT "EXTENSION "dblink""
483pg_restore: [archiver (db)] Error from TOC entry 3636; 0 0 COMMENT EXTENSION "dblink"
484pg_restore: [archiver (db)] could not execute query: ERROR: extension "dblink" does not exist
485 Command was: COMMENT ON EXTENSION "dblink" IS 'connect to other PostgreSQL databases from within a database';
486
487
488
489pg_restore: creating EXTENSION "earthdistance"
490pg_restore: [archiver (db)] Error from TOC entry 3; 3079 213431 EXTENSION earthdistance
491pg_restore: [archiver (db)] could not execute query: ERROR: required extension "cube" is not installed
492HINT: Use CREATE EXTENSION ... CASCADE to install required extensions too.
493 Command was: CREATE EXTENSION IF NOT EXISTS "earthdistance" WITH SCHEMA "public";
494
495
496
497pg_restore: creating COMMENT "EXTENSION "earthdistance""
498pg_restore: [archiver (db)] Error from TOC entry 3637; 0 0 COMMENT EXTENSION "earthdistance"
499pg_restore: [archiver (db)] could not execute query: ERROR: extension "earthdistance" does not exist
500 Command was: COMMENT ON EXTENSION "earthdistance" IS 'calculate great-circle distances on the surface of the Earth';
501
502
503
504pg_restore: creating EXTENSION "hstore"
505pg_restore: [archiver (db)] Error from TOC entry 2; 3079 373288 EXTENSION hstore
506pg_restore: [archiver (db)] could not execute query: ERROR: permission denied to create extension "hstore"
507HINT: Must be superuser to create this extension.
508 Command was: CREATE EXTENSION IF NOT EXISTS "hstore" WITH SCHEMA "public";
509
510
511
512pg_restore: creating COMMENT "EXTENSION "hstore""
513pg_restore: [archiver (db)] Error from TOC entry 3638; 0 0 COMMENT EXTENSION "hstore"
514pg_restore: [archiver (db)] could not execute query: ERROR: extension "hstore" does not exist
515 Command was: COMMENT ON EXTENSION "hstore" IS 'data type for storing sets of (key, value) pairs';
516
517
518
519pg_restore: creating EXTENSION "pg_stat_statements"
520pg_restore: [archiver (db)] Error from TOC entry 7; 3079 16400 EXTENSION pg_stat_statements
521pg_restore: [archiver (db)] could not execute query: ERROR: permission denied to create extension "pg_stat_statements"
522HINT: Must be superuser to create this extension.
523 Command was: CREATE EXTENSION IF NOT EXISTS "pg_stat_statements" WITH SCHEMA "public";
524
525
526
527pg_restore: creating COMMENT "EXTENSION "pg_stat_statements""
528pg_restore: [archiver (db)] Error from TOC entry 3639; 0 0 COMMENT EXTENSION "pg_stat_statements"
529pg_restore: [archiver (db)] could not execute query: ERROR: extension "pg_stat_statements" does not exist
530 Command was: COMMENT ON EXTENSION "pg_stat_statements" IS 'track execution statistics of all SQL statements executed';
531
532
533
534pg_restore: creating EXTENSION "tablefunc"
535pg_restore: [archiver (db)] Error from TOC entry 5; 3079 113517 EXTENSION tablefunc
536pg_restore: [archiver (db)] could not execute query: ERROR: permission denied to create extension "tablefunc"
537HINT: Must be superuser to create this extension.
538 Command was: CREATE EXTENSION IF NOT EXISTS "tablefunc" WITH SCHEMA "public";
539
540
541
542pg_restore: creating COMMENT "EXTENSION "tablefunc""
543pg_restore: [archiver (db)] Error from TOC entry 3640; 0 0 COMMENT EXTENSION "tablefunc"
544pg_restore: [archiver (db)] could not execute query: ERROR: extension "tablefunc" does not exist
545 Command was: COMMENT ON EXTENSION "tablefunc" IS 'functions that manipulate whole tables, including crosstab';
546
547
548
549pg_restore: creating TYPE "public.enum_customer_feedback_rejection_reason"
550pg_restore: creating TYPE "public.enum_enquiries_new_car_status"
551pg_restore: creating TYPE "public.enum_enquiries_valuation_reason"
552pg_restore: creating FUNCTION "public.partners_notify()"
553pg_restore: [archiver (db)] Error from TOC entry 413; 1255 94694 FUNCTION partners_notify() u6hvindjrfu37i
554pg_restore: [archiver (db)] could not execute query: ERROR: could not load library "/usr/local/lib/postgresql/plpgsql.so": dlopen(/usr/local/lib/postgresql/plpgsql.so, 10): Symbol not found: _SPI_register_trigger_data
555 Referenced from: /usr/local/lib/postgresql/plpgsql.so
556 Expected in: /usr/local/opt/postgresql/bin/postgres
557 in /usr/local/lib/postgresql/plpgsql.so
558 Command was: CREATE FUNCTION "public"."partners_notify"() RETURNS "trigger"
559 LANGUAGE "plpgsql"
560 AS $$
561BEGIN
562 PERFORM pg_notify('partners_updated', NEW.slug);
563 RETURN NULL;
564END;
565$$;
566
567
568
569pg_restore: creating FUNCTION "public.rules_notify()"
570pg_restore: [archiver (db)] Error from TOC entry 397; 1255 176547 FUNCTION rules_notify() u6hvindjrfu37i
571pg_restore: [archiver (db)] could not execute query: ERROR: could not load library "/usr/local/lib/postgresql/plpgsql.so": dlopen(/usr/local/lib/postgresql/plpgsql.so, 10): Symbol not found: _SPI_register_trigger_data
572 Referenced from: /usr/local/lib/postgresql/plpgsql.so
573 Expected in: /usr/local/opt/postgresql/bin/postgres
574 in /usr/local/lib/postgresql/plpgsql.so
575 Command was: CREATE FUNCTION "public"."rules_notify"() RETURNS "trigger"
576 LANGUAGE "plpgsql"
577 AS $$
578BEGIN
579 IF TG_OP = 'INSERT' OR TG_OP = 'UPDATE' THEN
580 PERFORM pg_notify('rules_update', json_build_object('table', TG_TABLE_NAME, 'id', NEW.id, 'type', TG_OP, 'rule', NEW)::text);
581ELSE
582 PERFORM pg_notify('rules_update', json_build_object('table', TG_TABLE_NAME, 'id', OLD.id, 'type', TG_OP)::text);
583END IF;
584RETURN NULL;
585END;
586$$;
587
588
589
590pg_restore: creating TABLE "public.SequelizeMeta"
591pg_restore: creating TABLE "public.affiliates"
592pg_restore: creating SEQUENCE "public.affiliates_id_seq"
593pg_restore: creating SEQUENCE OWNED BY "public.affiliates_id_seq"
594pg_restore: creating TABLE "public.branch_postcodes"
595pg_restore: creating SEQUENCE "public.branches_id_seq"
596pg_restore: creating TABLE "public.branches"
597pg_restore: creating SEQUENCE "public.partners_id_seq"
598pg_restore: creating TABLE "public.buyers"
599pg_restore: [archiver (db)] Error from TOC entry 301; 1259 16671 TABLE buyers u6hvindjrfu37i
600pg_restore: [archiver (db)] could not execute query: ERROR: relation "buyers" already exists
601 Command was: CREATE TABLE "public"."buyers" (
602 "id" integer DEFAULT "nextval"('"public"."partners_id_seq"'::"regclass") NOT NULL,
603 "slug" character varying(255) NOT NULL,
604 "name" character varying(255) NOT NULL,
605 "createdAt" timestamp with time zone NOT NULL,
606 "updatedAt" timestamp with time zone NOT NULL,
607 "displayPriority" integer DEFAULT 0 NOT NULL,
608 "category" character varying(255),
609 "status" character varying(255),
610 "partner" boolean DEFAULT true
611);
612
613
614
615pg_restore: creating TABLE "public.customer_feedback"
616pg_restore: creating SEQUENCE "public.customers_id_seq"
617pg_restore: creating TABLE "public.customers"
618pg_restore: creating SEQUENCE "public.enquiries_id_seq"
619pg_restore: creating TABLE "public.enquiries"
620pg_restore: [archiver (db)] Error from TOC entry 297; 1259 16652 TABLE enquiries u6hvindjrfu37i
621pg_restore: [archiver (db)] could not execute query: ERROR: type "public.hstore" does not exist
622LINE 17: "app_variant" "public"."hstore"
623 ^
624 Command was: CREATE TABLE "public"."enquiries" (
625 "id" integer DEFAULT "nextval"('"public"."enquiries_id_seq"'::"regclass") NOT NULL,
626 "mileage" integer,
627 "mileage_est" integer,
628 "mileage_last_mot" integer,
629 "createdAt" timestamp with time zone NOT NULL,
630 "updatedAt" timestamp with time zone NOT NULL,
631 "customerId" integer,
632 "vehicleId" integer,
633 "vehicle_removed" boolean,
634 "sent_to_ga" timestamp with time zone,
635 "tcbg_status" character varying(10) DEFAULT 'not sent'::character varying,
636 "affiliateId" integer,
637 "status" character varying(255) DEFAULT 'active'::character varying,
638 "valuation_reason" "public"."enum_enquiries_valuation_reason",
639 "new_car_status" "public"."enum_enquiries_new_car_status",
640 "app_variant" "public"."hstore"
641);
642
643
644
645pg_restore: creating SEQUENCE "public.makes_id_seq"
646pg_restore: creating TABLE "public.makes"
647pg_restore: creating TABLE "public.models"
648pg_restore: creating TABLE "public.tracking_data"
649pg_restore: creating SEQUENCE "public.valuation_status_histories_id_seq"
650pg_restore: [archiver (db)] Error from TOC entry 304; 1259 16684 SEQUENCE valuation_status_histories_id_seq u6hvindjrfu37i
651pg_restore: [archiver (db)] could not execute query: ERROR: relation "valuation_status_histories_id_seq" already exists
652 Command was: CREATE SEQUENCE "public"."valuation_status_histories_id_seq"
653 START WITH 1
654 INCREMENT BY 1
655 NO MINVALUE
656 NO MAXVALUE
657 CACHE 1;
658
659
660
661pg_restore: creating TABLE "public.valuation_states"
662pg_restore: creating SEQUENCE "public.valuations_id_seq"
663pg_restore: creating TABLE "public.valuations"
664pg_restore: creating SEQUENCE "public.vehicles_id_seq"
665pg_restore: creating TABLE "public.vehicles"
666pg_restore: creating VIEW "public.daily_enquiry"
667pg_restore: [archiver (db)] Error from TOC entry 327; 1259 478582 VIEW daily_enquiry u6hvindjrfu37i
668pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.enquiries" does not exist
669LINE 31: FROM (((((((("public"."enquiries" "e"
670 ^
671 Command was: CREATE VIEW "public"."daily_enquiry" AS
672 WITH "valstatuses" AS (
673 SELECT DISTINCT ON ("valuation_states"."valuationId") "valuation_states"."valuationId",
674 "valuation_states"."status",
675 "valuation_states"."createdAt"
676 FROM "public"."valuation_states"
677 ORDER BY "valuation_states"."valuationId", "valuation_states"."createdAt" DESC
678 )
679 SELECT ("e"."createdAt")::"date" AS "createdAt",
680 "v"."fuel",
681 "v"."colour",
682 "mod"."name" AS "Generic Model",
683 "p"."name" AS "Partner Name",
684 "v"."transmission",
685 CASE
686 WHEN (("val"."valuation" >= 0) AND ("val"."valuation" <= 499)) THEN '<500'::"text"
687 WHEN (("val"."valuation" >= 500) AND ("val"."valuation" <= 999)) THEN '500-1000'::"text"
688 WHEN (("val"."valuation" >= 1000) AND ("val"."valuation" <= 4999)) THEN '1-5k'::"text"
689 WHEN (("val"."valuation" >= 5000) AND ("val"."valuation" <= 9999)) THEN '5- 10k'::"text"
690 WHEN (("val"."valuation" >= 10000) AND ("val"."valuation" <= 14999)) THEN '10- 15k'::"text"
691 WHEN (("val"."valuation" >= 15000) AND ("val"."valuation" <= 19999)) THEN '15- 20k'::"text"
692 WHEN (("val"."valuation" >= 20000) AND ("val"."valuation" <= 29999)) THEN '20- 30k'::"text"
693 WHEN (("val"."valuation" >= 30000) AND ("val"."valuation" <= 39999)) THEN '30- 40k'::"text"
694 WHEN (("val"."valuation" >= 40000) AND ("val"."valuation" <= 49999)) THEN '40- 50k'::"text"
695 WHEN ("val"."valuation" > 50000) THEN '50+'::"text"
696 ELSE 'Non-numerical'::"text"
697 END AS "valuation_fork",
698 "m"."display_name" AS "Vehicle Make",
699 "v"."year",
700 "count"(*) AS "enquiry"
701 FROM (((((((("public"."enquiries" "e"
702 LEFT JOIN "public"."tracking_data" "td" ON (("td"."enquiryId" = "e"."id")))
703 LEFT JOIN "public"."customers" "c" ON (("c"."id" = "e"."customerId")))
704 LEFT JOIN "public"."vehicles" "v" ON (("v"."id" = "e"."vehicleId")))
705 LEFT JOIN "public"."models" "mod" ON (("mod"."id" = "v"."modelId")))
706 LEFT JOIN "public"."makes" "m" ON (("m"."id" = "v"."makeId")))
707 LEFT JOIN "public"."valuations" "val" ON (("val"."enquiryId" = "e"."id")))
708 JOIN "valstatuses" "vs" ON (("val"."id" = "vs"."valuationId")))
709 LEFT JOIN "public"."buyers" "p" ON (("p"."id" = "val"."buyerId")))
710 GROUP BY (("e"."createdAt")::"date"), "v"."fuel", "v"."colour", "mod"."name", "p"."name", "v"."transmission",
711 CASE
712 WHEN (("val"."valuation" >= 0) AND ("val"."valuation" <= 499)) THEN '<500'::"text"
713 WHEN (("val"."valuation" >= 500) AND ("val"."valuation" <= 999)) THEN '500-1000'::"text"
714 WHEN (("val"."valuation" >= 1000) AND ("val"."valuation" <= 4999)) THEN '1-5k'::"text"
715 WHEN (("val"."valuation" >= 5000) AND ("val"."valuation" <= 9999)) THEN '5- 10k'::"text"
716 WHEN (("val"."valuation" >= 10000) AND ("val"."valuation" <= 14999)) THEN '10- 15k'::"text"
717 WHEN (("val"."valuation" >= 15000) AND ("val"."valuation" <= 19999)) THEN '15- 20k'::"text"
718 WHEN (("val"."valuation" >= 20000) AND ("val"."valuation" <= 29999)) THEN '20- 30k'::"text"
719 WHEN (("val"."valuation" >= 30000) AND ("val"."valuation" <= 39999)) THEN '30- 40k'::"text"
720 WHEN (("val"."valuation" >= 40000) AND ("val"."valuation" <= 49999)) THEN '40- 50k'::"text"
721 WHEN ("val"."valuation" > 50000) THEN '50+'::"text"
722 ELSE 'Non-numerical'::"text"
723 END, "m"."display_name", "v"."year";
724
725
726
727pg_restore: creating TABLE "public.eligibilities"
728pg_restore: creating SEQUENCE "public.eligibilities_id_seq"
729pg_restore: creating SEQUENCE OWNED BY "public.eligibilities_id_seq"
730pg_restore: creating TABLE "public.eligibility_rules"
731pg_restore: creating SEQUENCE "public.eligibility_rules_id_seq"
732pg_restore: creating SEQUENCE OWNED BY "public.eligibility_rules_id_seq"
733pg_restore: creating VIEW "public.enquiry_day"
734pg_restore: creating SEQUENCE "public.gen_models_id_seq"
735pg_restore: creating SEQUENCE OWNED BY "public.gen_models_id_seq"
736pg_restore: creating VIEW "public.gig_performance"
737pg_restore: [archiver (db)] Error from TOC entry 331; 1259 635582 VIEW gig_performance u6hvindjrfu37i
738pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.enquiries" does not exist
739LINE 76: FROM (((((((((("public"."enquiries" "e"
740 ^
741 Command was: CREATE VIEW "public"."gig_performance" AS
742 WITH "valstatuses" AS (
743 SELECT DISTINCT ON ("valuation_states"."valuationId") "valuation_states"."valuationId",
744 "valuation_states"."status",
745 "valuation_states"."createdAt"
746 FROM "public"."valuation_states"
747 ORDER BY "valuation_states"."valuationId", "valuation_states"."createdAt" DESC
748 )
749 SELECT ("e"."createdAt")::"date" AS "Enquiry created",
750 'Get It Gone'::character varying AS "Partner Name",
751 "e"."tcbg_status",
752 "v"."colour",
753 "v"."engine_size",
754 "m"."display_name" AS "Vehicle make",
755 "v"."model" AS "Vehicle model",
756 "mod"."name" AS "Generic model",
757 "v"."body" AS "Body type",
758 "v"."fuel" AS "Fuel",
759 ("e"."mileage" || ''::"text") AS "Vehicle mileage",
760 ("v"."year" || ''::"text") AS "Vehicle Year",
761 "v"."transmission" AS "Transmission",
762 CASE
763 WHEN (("max"((("val"."valuation")::double precision)::integer) >= 0) AND ("max"((("val"."valuation")::double precision)::integer) <= 499)) THEN '<500'::"text"
764 WHEN (("max"((("val"."valuation")::double precision)::integer) >= 500) AND ("max"((("val"."valuation")::double precision)::integer) <= 999)) THEN '500-1000'::"text"
765 WHEN (("max"((("val"."valuation")::double precision)::integer) >= 1000) AND ("max"((("val"."valuation")::double precision)::integer) <= 4999)) THEN '1-5k'::"text"
766 WHEN (("max"((("val"."valuation")::double precision)::integer) >= 5000) AND ("max"((("val"."valuation")::double precision)::integer) <= 9999)) THEN '5- 10k'::"text"
767 WHEN (("max"((("val"."valuation")::double precision)::integer) >= 10000) AND ("max"((("val"."valuation")::double precision)::integer) <= 14999)) THEN '10- 15k'::"text"
768 WHEN (("max"((("val"."valuation")::double precision)::integer) >= 15000) AND ("max"((("val"."valuation")::double precision)::integer) <= 19999)) THEN '15- 20k'::"text"
769 WHEN (("max"((("val"."valuation")::double precision)::integer) >= 20000) AND ("max"((("val"."valuation")::double precision)::integer) <= 29999)) THEN '20- 30k'::"text"
770 WHEN (("max"((("val"."valuation")::double precision)::integer) >= 30000) AND ("max"((("val"."valuation")::double precision)::integer) <= 39999)) THEN '30- 40k'::"text"
771 WHEN (("max"((("val"."valuation")::double precision)::integer) >= 40000) AND ("max"((("val"."valuation")::double precision)::integer) <= 49999)) THEN '40- 50k'::"text"
772 WHEN ("max"((("val"."valuation")::double precision)::integer) > 50000) THEN '50+'::"text"
773 ELSE 'Non-numerical'::"text"
774 END AS "Valuation Fork",
775 1 AS "All time Offer Selected",
776 CASE
777 WHEN (("gig_vs"."status")::"text" = 'offer selected'::"text") THEN '1'::"text"
778 ELSE '0'::"text"
779 END AS "Latest Status: Offer selected",
780 CASE
781 WHEN (("gig_vs"."status")::"text" = 'offer rejected'::"text") THEN '1'::"text"
782 ELSE '0'::"text"
783 END AS "Offer rejected",
784 CASE
785 WHEN (("gig_vs"."status")::"text" = 'appointment attended'::"text") THEN '1'::"text"
786 ELSE '0'::"text"
787 END AS "Appointment attended",
788 CASE
789 WHEN (("gig_vs"."status")::"text" = 'appointment booked'::"text") THEN '1'::"text"
790 ELSE '0'::"text"
791 END AS "Latest Status: Appointment booked",
792 CASE
793 WHEN (("gig_vs"."status")::"text" = 'appointment booked'::"text") THEN '1'::"text"
794 ELSE '0'::"text"
795 END AS "All Time: Appointment booked",
796 CASE
797 WHEN (("gig_vs"."status")::"text" = 'sale complete'::"text") THEN '1'::"text"
798 ELSE '0'::"text"
799 END AS "Sale complete",
800 CASE
801 WHEN (("gig_vs"."status")::"text" = 'uncontactable'::"text") THEN '1'::"text"
802 ELSE '0'::"text"
803 END AS "Uncontactable",
804 CASE
805 WHEN (("gig_vs"."status")::"text" = 'invalid'::"text") THEN '1'::"text"
806 ELSE '0'::"text"
807 END AS "Invalid",
808 'Get It Gone'::character varying AS "New Partner Name",
809 'true'::character varying AS "Auto Leads",
810 CASE
811 WHEN (("gig_vs"."status")::"text" = 'appointment booked'::"text") THEN '0.95'::"text"
812 ELSE NULL::"text"
813 END AS "Estimated Sales",
814 0 AS "Estimated Revenue",
815 0 AS "Revenue"
816 FROM (((((((((("public"."enquiries" "e"
817 JOIN "public"."valuations" "gig_val" ON ((("gig_val"."enquiryId" = "e"."id") AND ("gig_val"."buyerId" = 9) AND ((("gig_val"."status")::"text" = 'success'::"text") OR (("gig_val"."status")::"text" = 'no-valuation-data'::"text")))))
818 JOIN "valstatuses" "gig_vs" ON (("gig_val"."id" = "gig_vs"."valuationId")))
819 LEFT JOIN "public"."customers" "c" ON (("c"."id" = "e"."customerId")))
820 LEFT JOIN "public"."vehicles" "v" ON (("v"."id" = "e"."vehicleId")))
821 LEFT JOIN "public"."models" "mod" ON (("mod"."id" = "v"."modelId")))
822 LEFT JOIN "public"."makes" "m" ON (("m"."id" = "v"."makeId")))
823 LEFT JOIN "public"."valuations" "val" ON (("val"."enquiryId" = "e"."id")))
824 LEFT JOIN "public"."buyers" "b" ON (("b"."id" = "val"."buyerId")))
825 RIGHT JOIN "public"."eligibilities" "el" ON (("e"."id" = "el"."enquiryId")))
826 LEFT JOIN "public"."eligibility_rules" "elr" ON (("el"."ruleId" = "elr"."id")))
827 WHERE ("e"."createdAt" >= '2018-04-01 00:00:00+00'::timestamp with time zone)
828 GROUP BY "e"."id", (("e"."createdAt")::"date"), "gig_vs"."status", "e"."tcbg_status", "v"."colour", "v"."engine_size", "m"."display_name", "v"."model", "mod"."name", "v"."body", "v"."fuel", ("e"."mileage" || ''::"text"), ("v"."year" || ''::"text"), "v"."transmission";
829
830
831
832pg_restore: creating TABLE "public.model_variants"
833pg_restore: creating SEQUENCE "public.gov_models_id_seq"
834pg_restore: creating SEQUENCE OWNED BY "public.gov_models_id_seq"
835pg_restore: creating VIEW "public.hello"
836pg_restore: creating VIEW "public.partner_performance"
837pg_restore: [archiver (db)] Error from TOC entry 332; 1259 678233 VIEW partner_performance u6hvindjrfu37i
838pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.enquiries" does not exist
839LINE 178: FROM ((((((("public"."enquiries" "e"
840 ^
841 Command was: CREATE VIEW "public"."partner_performance" AS
842 WITH "statuses" AS (
843 SELECT "valuation_states"."valuationId",
844 "valuation_states"."status",
845 "valuation_states"."createdAt"
846 FROM "public"."valuation_states"
847 ), "lateststatuses" AS (
848 SELECT DISTINCT ON ("valuation_states"."valuationId") "valuation_states"."valuationId",
849 "valuation_states"."status",
850 "valuation_states"."createdAt"
851 FROM "public"."valuation_states"
852 ORDER BY "valuation_states"."valuationId", "valuation_states"."createdAt" DESC
853 ), "valstatuses" AS (
854 SELECT DISTINCT ON ("valuation_states"."valuationId") "valuation_states"."valuationId",
855 "valuation_states"."status",
856 "valuation_states"."createdAt"
857 FROM "public"."valuation_states"
858 ORDER BY "valuation_states"."valuationId", "valuation_states"."createdAt" DESC
859 )
860 SELECT "a"."Enquiry created",
861 "a"."Partner Name",
862 "a"."tcbg_status",
863 "a"."colour",
864 "a"."engine_size",
865 "a"."Vehicle make",
866 "a"."Vehicle model",
867 "a"."Generic model",
868 "a"."Body",
869 "a"."Poop" AS "Fuel",
870 "a"."Vehicle mileage",
871 "a"."Year",
872 "a"."transmission",
873 "a"."valuation_fork" AS "Valuation Fork",
874 CASE
875 WHEN ((("a"."tcbg_status")::"text" = 'sent'::"text") AND (("a"."Partner Name")::"text" = 'The Car Buying Group'::"text")) THEN (0)::bigint
876 ELSE "a"."All Time Offer selected"
877 END AS "All Time Offer selected",
878 "a"."Latest Status: Offer selected",
879 "a"."Offer rejected",
880 "a"."Appointment attended",
881 "a"."Latest Status: Appointment booked",
882 "a"."All Time: Appointment booked",
883 "a"."Sale complete",
884 "a"."Uncontactable",
885 "a"."Invalid",
886 CASE
887 WHEN ((("a"."tcbg_status")::"text" = 'sent'::"text") AND (("a"."Partner Name")::"text" = 'The Car Buying Group'::"text")) THEN 'The Car Buying Group Passive'::character varying
888 ELSE "a"."Partner Name"
889 END AS "New Partner Name",
890 CASE
891 WHEN (("a"."tcbg_status")::"text" = 'sent'::"text") THEN 'true'::"text"
892 ELSE 'false'::"text"
893 END AS "Auto Leads",
894 CASE
895 WHEN ((("a"."Partner Name")::"text" = 'The Car Buying Group'::"text") AND ("a"."Enquiry created" < '2017-11-01'::"date")) THEN (0.65 * ("a"."Latest Status: Appointment booked")::numeric)
896 WHEN ((("a"."Partner Name")::"text" = 'The Car Buying Group'::"text") AND ("a"."Enquiry created" > '2017-11-01'::"date")) THEN (0.85 * ("a"."Latest Status: Appointment booked")::numeric)
897 WHEN (("a"."Partner Name")::"text" = 'Elite Car Buyer'::"text") THEN (0.80 * ("a"."Latest Status: Appointment booked")::numeric)
898 WHEN (("a"."Partner Name")::"text" = 'Best Price For Cars'::"text") THEN (0.85 * ("a"."Latest Status: Appointment booked")::numeric)
899 WHEN ((("a"."Partner Name")::"text" = 'We Buy Cars Today'::"text") AND ("a"."Enquiry created" < '2017-07-01'::"date")) THEN (0.30 * ("a"."Latest Status: Appointment booked")::numeric)
900 WHEN ((("a"."Partner Name")::"text" = 'We Buy Cars Today'::"text") AND ("a"."Enquiry created" > '2017-07-01'::"date")) THEN (0.35 * ("a"."Latest Status: Appointment booked")::numeric)
901 WHEN (("a"."Partner Name")::"text" = 'We Want Any Car'::"text") THEN (0.40 * ("a"."Latest Status: Appointment booked")::numeric)
902 WHEN (("a"."Partner Name")::"text" = 'Buy My Car'::"text") THEN (0.10 * ("a"."Latest Status: Appointment booked")::numeric)
903 WHEN (("a"."Partner Name")::"text" = 'CarTakeBack'::"text") THEN (0.5 * ("a"."Latest Status: Appointment booked")::numeric)
904 WHEN (("a"."Partner Name")::"text" = 'Trusted Car Buyers'::"text") THEN (0.3 * ("a"."Latest Status: Appointment booked")::numeric)
905 WHEN (("a"."Partner Name")::"text" = 'Get It Gone'::"text") THEN (0.95 * ("a"."Latest Status: Appointment booked")::numeric)
906 WHEN (("a"."Partner Name")::"text" = 'Best Car Buyer'::"text") THEN (0.75 * ("a"."Latest Status: Appointment booked")::numeric)
907 WHEN (("a"."Partner Name")::"text" = 'Money4YourMotors'::"text") THEN (0.63 * ("a"."Latest Status: Appointment booked")::numeric)
908 ELSE (0)::numeric
909 END AS "Estimated Sales",
910 CASE
911 WHEN ((("a"."Partner Name")::"text" = 'The Car Buying Group'::"text") AND ("a"."Enquiry created" < '2017-11-01'::"date")) THEN (48.8 * ("a"."Latest Status: Appointment booked")::numeric)
912 WHEN ((("a"."Partner Name")::"text" = 'The Car Buying Group'::"text") AND ("a"."Enquiry created" > '2017-11-01'::"date")) THEN ((68 * "a"."Latest Status: Appointment booked"))::numeric
913 WHEN (("a"."Partner Name")::"text" = 'Elite Car Buyer'::"text") THEN ((64 * "a"."Latest Status: Appointment booked"))::numeric
914 WHEN (("a"."Partner Name")::"text" = 'Best Price For Cars'::"text") THEN ((64 * "a"."Latest Status: Appointment booked"))::numeric
915 WHEN ((("a"."Partner Name")::"text" = 'We Buy Cars Today'::"text") AND ("a"."Enquiry created" < '2017-07-01'::"date")) THEN ((15 * "a"."Latest Status: Appointment booked"))::numeric
916 WHEN ((("a"."Partner Name")::"text" = 'We Buy Cars Today'::"text") AND ("a"."Enquiry created" > '2017-07-01'::"date")) THEN (21.9 * ("a"."Latest Status: Appointment booked")::numeric)
917 WHEN (("a"."Partner Name")::"text" = 'We Want Any Car'::"text") THEN ((30 * "a"."Latest Status: Appointment booked"))::numeric
918 WHEN (("a"."Partner Name")::"text" = 'Buy My Car'::"text") THEN (7.5 * ("a"."Latest Status: Appointment booked")::numeric)
919 WHEN ((("a"."Partner Name")::"text" = 'CarTakeBack'::"text") AND ("a"."Enquiry created" < '2017-08-01'::"date")) THEN ((5 * "a"."Latest Status: Appointment booked"))::numeric
920 WHEN ((("a"."Partner Name")::"text" = 'CarTakeBack'::"text") AND (("a"."Enquiry created" >= '2017-08-01'::"date") AND ("a"."Enquiry created" <= '2017-08-31'::"date"))) THEN (7.5 * ("a"."Latest Status: Appointment booked")::numeric)
921 WHEN ((("a"."Partner Name")::"text" = 'CarTakeBack'::"text") AND ("a"."Enquiry created" > '2017-08-31'::"date")) THEN ((5 * "a"."Latest Status: Appointment booked"))::numeric
922 WHEN (("a"."Partner Name")::"text" = 'Trusted Car Buyers'::"text") THEN ((27 * "a"."Latest Status: Appointment booked"))::numeric
923 WHEN ((("a"."Partner Name")::"text" = 'Get It Gone'::"text") AND ("a"."Enquiry created" < '2018-07-01'::"date")) THEN (118.8 * ("a"."Latest Status: Appointment booked")::numeric)
924 WHEN (("a"."Partner Name")::"text" = 'Best Car Buyer'::"text") THEN (67.5 * ("a"."Latest Status: Appointment booked")::numeric)
925 WHEN (("a"."Partner Name")::"text" = 'Best Car Buyer'::"text") THEN (67.5 * ("a"."Latest Status: Appointment booked")::numeric)
926 WHEN (("a"."Partner Name")::"text" = 'Money4YourMotors'::"text") THEN (47.3 * ("a"."Latest Status: Appointment booked")::numeric)
927 ELSE '0'::numeric
928 END AS "Estimated Revenue",
929 CASE
930 WHEN ((("a"."Partner Name")::"text" = 'The Car Buying Group'::"text") AND ("a"."Enquiry created" < '2017-11-01'::"date")) THEN ((75 * "a"."Sale complete"))::numeric
931 WHEN ((("a"."Partner Name")::"text" = 'The Car Buying Group'::"text") AND ("a"."Enquiry created" > '2017-11-01'::"date")) THEN ((80 * "a"."Sale complete"))::numeric
932 WHEN (("a"."Partner Name")::"text" = 'Elite Car Buyer'::"text") THEN ((80 * "a"."Sale complete"))::numeric
933 WHEN (("a"."Partner Name")::"text" = 'Best Price For Cars'::"text") THEN ((80 * "a"."Sale complete"))::numeric
934 WHEN ((("a"."Partner Name")::"text" = 'We Buy Cars Today'::"text") AND ("a"."Enquiry created" < '2017-07-01'::"date")) THEN ((50 * "a"."Sale complete"))::numeric
935 WHEN ((("a"."Partner Name")::"text" = 'We Buy Cars Today'::"text") AND ("a"."Enquiry created" > '2017-07-01'::"date")) THEN (62.5 * ("a"."Sale complete")::numeric)
936 WHEN (("a"."Partner Name")::"text" = 'We Want Any Car'::"text") THEN ((75 * "a"."Sale complete"))::numeric
937 WHEN (("a"."Partner Name")::"text" = 'Buy My Car'::"text") THEN ((75 * "a"."Sale complete"))::numeric
938 WHEN ((("a"."Partner Name")::"text" = 'CarTakeBack'::"text") AND ("a"."Enquiry created" < '2017-08-01'::"date")) THEN ((10 * "a"."Sale complete"))::numeric
939 WHEN ((("a"."Partner Name")::"text" = 'CarTakeBack'::"text") AND (("a"."Enquiry created" >= '2017-08-01'::"date") AND ("a"."Enquiry created" <= '2017-08-31'::"date"))) THEN ((15 * "a"."Sale complete"))::numeric
940 WHEN ((("a"."Partner Name")::"text" = 'CarTakeBack'::"text") AND ("a"."Enquiry created" > '2017-08-30'::"date")) THEN ((10 * "a"."Sale complete"))::numeric
941 WHEN (("a"."Partner Name")::"text" = 'Trusted Car Buyers'::"text") THEN ((90 * "a"."Sale complete"))::numeric
942 WHEN ((("a"."Partner Name")::"text" = 'Get It Gone'::"text") AND ("a"."Enquiry created" < '2018-07-01'::"date")) THEN ((125 * "a"."Sale complete"))::numeric
943 WHEN (("a"."Partner Name")::"text" = 'Best Car Buyer'::"text") THEN ((90 * "a"."Sale complete"))::numeric
944 WHEN (("a"."Partner Name")::"text" = 'Money4YourMotors'::"text") THEN ((75 * "a"."Sale complete"))::numeric
945 ELSE '0'::numeric
946 END AS "Revenue"
947 FROM ( SELECT ("e"."createdAt")::"date" AS "Enquiry created",
948 "p"."name" AS "Partner Name",
949 "e"."tcbg_status",
950 "v"."colour",
951 "v"."engine_size",
952 "m"."display_name" AS "Vehicle make",
953 "v"."model" AS "Vehicle model",
954 "mod"."name" AS "Generic model",
955 "v"."body" AS "Body",
956 "v"."fuel" AS "Poop",
957 "e"."mileage" AS "Vehicle mileage",
958 "v"."year" AS "Year",
959 "v"."transmission",
960 CASE
961 WHEN (("val"."valuation" >= 0) AND ("val"."valuation" <= 499)) THEN '<500'::"text"
962 WHEN (("val"."valuation" >= 500) AND ("val"."valuation" <= 999)) THEN '500-1000'::"text"
963 WHEN (("val"."valuation" >= 1000) AND ("val"."valuation" <= 4999)) THEN '1-5k'::"text"
964 WHEN (("val"."valuation" >= 5000) AND ("val"."valuation" <= 9999)) THEN '5- 10k'::"text"
965 WHEN (("val"."valuation" >= 10000) AND ("val"."valuation" <= 14999)) THEN '10- 15k'::"text"
966 WHEN (("val"."valuation" >= 15000) AND ("val"."valuation" <= 19999)) THEN '15- 20k'::"text"
967 WHEN (("val"."valuation" >= 20000) AND ("val"."valuation" <= 29999)) THEN '20- 30k'::"text"
968 WHEN (("val"."valuation" >= 30000) AND ("val"."valuation" <= 39999)) THEN '30- 40k'::"text"
969 WHEN (("val"."valuation" >= 40000) AND ("val"."valuation" <= 49999)) THEN '40- 50k'::"text"
970 WHEN ("val"."valuation" > 50000) THEN '50+'::"text"
971 ELSE 'Non-numerical'::"text"
972 END AS "valuation_fork",
973 "sum"(
974 CASE
975 WHEN (("vs"."status")::"text" = 'offer selected'::"text") THEN 1
976 ELSE 0
977 END) AS "All Time Offer selected",
978 "sum"(
979 CASE
980 WHEN (("vs2"."status")::"text" = 'offer selected'::"text") THEN 1
981 ELSE 0
982 END) AS "Latest Status: Offer selected",
983 "sum"(
984 CASE
985 WHEN (("vs2"."status")::"text" = 'offer rejected'::"text") THEN 1
986 ELSE 0
987 END) AS "Offer rejected",
988 "sum"(
989 CASE
990 WHEN (("vs2"."status")::"text" = 'appointment attended'::"text") THEN 1
991 ELSE 0
992 END) AS "Appointment attended",
993 "sum"(
994 CASE
995 WHEN (("vs2"."status")::"text" = 'appointment booked'::"text") THEN 1
996 ELSE 0
997 END) AS "Latest Status: Appointment booked",
998 "sum"(
999 CASE
1000 WHEN (("vs"."status")::"text" = 'appointment booked'::"text") THEN 1
1001 ELSE 0
1002 END) AS "All Time: Appointment booked",
1003 "sum"(
1004 CASE
1005 WHEN (("vs2"."status")::"text" = 'sale complete'::"text") THEN 1
1006 ELSE 0
1007 END) AS "Sale complete",
1008 "sum"(
1009 CASE
1010 WHEN (("vs2"."status")::"text" = 'uncontactable'::"text") THEN 1
1011 ELSE 0
1012 END) AS "Uncontactable",
1013 "sum"(
1014 CASE
1015 WHEN (("vs2"."status")::"text" = 'invalid'::"text") THEN 1
1016 ELSE 0
1017 END) AS "Invalid"
1018 FROM ((((((("public"."enquiries" "e"
1019 LEFT JOIN "public"."vehicles" "v" ON (("v"."id" = "e"."vehicleId")))
1020 LEFT JOIN "public"."makes" "m" ON (("m"."id" = "v"."makeId")))
1021 LEFT JOIN "public"."models" "mod" ON (("mod"."id" = "v"."modelId")))
1022 JOIN "public"."valuations" "val" ON (("val"."enquiryId" = "e"."id")))
1023 JOIN ( SELECT "buyers"."id",
1024 "buyers"."slug",
1025 "buyers"."name",
1026 "buyers"."createdAt",
1027 "buyers"."updatedAt",
1028 "buyers"."displayPriority",
1029 "buyers"."category",
1030 "buyers"."status",
1031 "buyers"."partner"
1032 FROM "public"."buyers"
1033 WHERE (("buyers"."name")::"text" <> 'Get It Gone'::"text")) "p" ON (("val"."buyerId" = "p"."id")))
1034 JOIN "statuses" "vs" ON (("val"."id" = "vs"."valuationId")))
1035 LEFT JOIN "lateststatuses" "vs2" ON ((("val"."id" = "vs2"."valuationId") AND ("vs"."createdAt" = "vs2"."createdAt"))))
1036 GROUP BY (("e"."createdAt")::"date"), "e"."tcbg_status", "p"."name", "v"."colour", "v"."engine_size", "v"."fuel", "m"."display_name", "v"."model", "mod"."name", "v"."body", "e"."mileage", "v"."year", "v"."transmission",
1037 CASE
1038 WHEN (("val"."valuation" >= 0) AND ("val"."valuation" <= 499)) THEN '<500'::"text"
1039 WHEN (("val"."valuation" >= 500) AND ("val"."valuation" <= 999)) THEN '500-1000'::"text"
1040 WHEN (("val"."valuation" >= 1000) AND ("val"."valuation" <= 4999)) THEN '1-5k'::"text"
1041 WHEN (("val"."valuation" >= 5000) AND ("val"."valuation" <= 9999)) THEN '5- 10k'::"text"
1042 WHEN (("val"."valuation" >= 10000) AND ("val"."valuation" <= 14999)) THEN '10- 15k'::"text"
1043 WHEN (("val"."valuation" >= 15000) AND ("val"."valuation" <= 19999)) THEN '15- 20k'::"text"
1044 WHEN (("val"."valuation" >= 20000) AND ("val"."valuation" <= 29999)) THEN '20- 30k'::"text"
1045 WHEN (("val"."valuation" >= 30000) AND ("val"."valuation" <= 39999)) THEN '30- 40k'::"text"
1046 WHEN (("val"."valuation" >= 40000) AND ("val"."valuation" <= 49999)) THEN '40- 50k'::"text"
1047 WHEN ("val"."valuation" > 50000) THEN '50+'::"text"
1048 ELSE 'Non-numerical'::"text"
1049 END) "a"
1050 WHERE ((((((("a"."Latest Status: Offer selected" + "a"."Offer rejected") + "a"."Appointment attended") + "a"."Latest Status: Appointment booked") + "a"."Sale complete") + "a"."Uncontactable") + "a"."Invalid") > 0)
1051UNION
1052 SELECT ("e"."createdAt")::"date" AS "Enquiry created",
1053 'The Car Buying Group Passive'::character varying AS "Partner Name",
1054 'sent'::character varying AS "tcbg_status",
1055 "v"."colour",
1056 "v"."engine_size",
1057 "m"."display_name" AS "Vehicle make",
1058 "v"."model" AS "Vehicle model",
1059 "mod"."name" AS "Generic model",
1060 "v"."body" AS "Body",
1061 "v"."fuel" AS "Fuel",
1062 "e"."mileage" AS "Vehicle mileage",
1063 "v"."year" AS "Year",
1064 "v"."transmission",
1065 CASE
1066 WHEN (("b"."valuation" >= 0) AND ("b"."valuation" <= 499)) THEN '<500'::"text"
1067 WHEN (("b"."valuation" >= 500) AND ("b"."valuation" <= 999)) THEN '500-1000'::"text"
1068 WHEN (("b"."valuation" >= 1000) AND ("b"."valuation" <= 4999)) THEN '1-5k'::"text"
1069 WHEN (("b"."valuation" >= 5000) AND ("b"."valuation" <= 9999)) THEN '5- 10k'::"text"
1070 WHEN (("b"."valuation" >= 10000) AND ("b"."valuation" <= 14999)) THEN '10- 15k'::"text"
1071 WHEN (("b"."valuation" >= 15000) AND ("b"."valuation" <= 19999)) THEN '15- 20k'::"text"
1072 WHEN (("b"."valuation" >= 20000) AND ("b"."valuation" <= 29999)) THEN '20- 30k'::"text"
1073 WHEN (("b"."valuation" >= 30000) AND ("b"."valuation" <= 39999)) THEN '30- 40k'::"text"
1074 WHEN (("b"."valuation" >= 40000) AND ("b"."valuation" <= 49999)) THEN '40- 50k'::"text"
1075 WHEN ("b"."valuation" > 50000) THEN '50+'::"text"
1076 ELSE 'Non-numerical'::"text"
1077 END AS "Valuation Fork",
1078 "count"("e"."id") AS "All Time Offer selected",
1079 0 AS "Latest Status: Offer selected",
1080 0 AS "Offer rejected",
1081 0 AS "Appointment attended",
1082 0 AS "Latest Status: Appointment booked",
1083 0 AS "All Time: Appointment booked",
1084 0 AS "Sale complete",
1085 0 AS "Uncontactable",
1086 0 AS "Invalid",
1087 'The Car Buying Group Passive'::character varying AS "New Partner Name",
1088 'true'::character varying AS "Auto Leads",
1089 0 AS "Estimated Sales",
1090 0 AS "Estimated Revenue",
1091 0 AS "Revenue"
1092 FROM (((("public"."enquiries" "e"
1093 LEFT JOIN "public"."vehicles" "v" ON (("v"."id" = "e"."vehicleId")))
1094 LEFT JOIN ( SELECT "valuations"."enquiryId",
1095 "max"("valuations"."valuation") AS "valuation"
1096 FROM "public"."valuations"
1097 GROUP BY "valuations"."enquiryId") "b" ON (("e"."id" = "b"."enquiryId")))
1098 LEFT JOIN "public"."makes" "m" ON (("m"."id" = "v"."makeId")))
1099 LEFT JOIN "public"."models" "mod" ON (("mod"."id" = "v"."modelId")))
1100 WHERE (("e"."tcbg_status")::"text" = 'sent'::"text")
1101 GROUP BY (("e"."createdAt")::"date"), "v"."colour", "v"."engine_size", "v"."fuel", "m"."display_name", "v"."model", "mod"."name", "v"."body", "e"."mileage", "v"."year", "v"."transmission",
1102 CASE
1103 WHEN (("b"."valuation" >= 0) AND ("b"."valuation" <= 499)) THEN '<500'::"text"
1104 WHEN (("b"."valuation" >= 500) AND ("b"."valuation" <= 999)) THEN '500-1000'::"text"
1105 WHEN (("b"."valuation" >= 1000) AND ("b"."valuation" <= 4999)) THEN '1-5k'::"text"
1106 WHEN (("b"."valuation" >= 5000) AND ("b"."valuation" <= 9999)) THEN '5- 10k'::"text"
1107 WHEN (("b"."valuation" >= 10000) AND ("b"."valuation" <= 14999)) THEN '10- 15k'::"text"
1108 WHEN (("b"."valuation" >= 15000) AND ("b"."valuation" <= 19999)) THEN '15- 20k'::"text"
1109 WHEN (("b"."valuation" >= 20000) AND ("b"."valuation" <= 29999)) THEN '20- 30k'::"text"
1110 WHEN (("b"."valuation" >= 30000) AND ("b"."valuation" <= 39999)) THEN '30- 40k'::"text"
1111 WHEN (("b"."valuation" >= 40000) AND ("b"."valuation" <= 49999)) THEN '40- 50k'::"text"
1112 WHEN ("b"."valuation" > 50000) THEN '50+'::"text"
1113 ELSE 'Non-numerical'::"text"
1114 END
1115UNION
1116 SELECT ("e"."createdAt")::"date" AS "Enquiry created",
1117 'Get It Gone'::character varying AS "Partner Name",
1118 "e"."tcbg_status",
1119 "v"."colour",
1120 "v"."engine_size",
1121 "m"."display_name" AS "Vehicle make",
1122 "v"."model" AS "Vehicle model",
1123 "mod"."name" AS "Generic model",
1124 "v"."body" AS "Body",
1125 "v"."fuel" AS "Fuel",
1126 (("e"."mileage" || ''::"text"))::integer AS "Vehicle mileage",
1127 (("v"."year" || ''::"text"))::integer AS "Year",
1128 "v"."transmission",
1129 CASE
1130 WHEN (("max"((("val"."valuation")::double precision)::integer) >= 0) AND ("max"((("val"."valuation")::double precision)::integer) <= 499)) THEN '<500'::"text"
1131 WHEN (("max"((("val"."valuation")::double precision)::integer) >= 500) AND ("max"((("val"."valuation")::double precision)::integer) <= 999)) THEN '500-1000'::"text"
1132 WHEN (("max"((("val"."valuation")::double precision)::integer) >= 1000) AND ("max"((("val"."valuation")::double precision)::integer) <= 4999)) THEN '1-5k'::"text"
1133 WHEN (("max"((("val"."valuation")::double precision)::integer) >= 5000) AND ("max"((("val"."valuation")::double precision)::integer) <= 9999)) THEN '5- 10k'::"text"
1134 WHEN (("max"((("val"."valuation")::double precision)::integer) >= 10000) AND ("max"((("val"."valuation")::double precision)::integer) <= 14999)) THEN '10- 15k'::"text"
1135 WHEN (("max"((("val"."valuation")::double precision)::integer) >= 15000) AND ("max"((("val"."valuation")::double precision)::integer) <= 19999)) THEN '15- 20k'::"text"
1136 WHEN (("max"((("val"."valuation")::double precision)::integer) >= 20000) AND ("max"((("val"."valuation")::double precision)::integer) <= 29999)) THEN '20- 30k'::"text"
1137 WHEN (("max"((("val"."valuation")::double precision)::integer) >= 30000) AND ("max"((("val"."valuation")::double precision)::integer) <= 39999)) THEN '30- 40k'::"text"
1138 WHEN (("max"((("val"."valuation")::double precision)::integer) >= 40000) AND ("max"((("val"."valuation")::double precision)::integer) <= 49999)) THEN '40- 50k'::"text"
1139 WHEN ("max"((("val"."valuation")::double precision)::integer) > 50000) THEN '50+'::"text"
1140 ELSE 'Non-numerical'::"text"
1141 END AS "Valuation Fork",
1142 1 AS "All Time Offer selected",
1143 CASE
1144 WHEN (("gig_vs"."status")::"text" = 'offer selected'::"text") THEN 1
1145 ELSE 0
1146 END AS "Latest Status: Offer selected",
1147 CASE
1148 WHEN (("gig_vs"."status")::"text" = 'offer rejected'::"text") THEN 1
1149 ELSE 0
1150 END AS "Offer rejected",
1151 CASE
1152 WHEN (("gig_vs"."status")::"text" = 'appointment attended'::"text") THEN 1
1153 ELSE 0
1154 END AS "Appointment attended",
1155 CASE
1156 WHEN (("gig_vs"."status")::"text" = 'appointment booked'::"text") THEN 1
1157 ELSE 0
1158 END AS "Latest Status: Appointment booked",
1159 CASE
1160 WHEN (("gig_vs"."status")::"text" = 'appointment booked'::"text") THEN 1
1161 ELSE 0
1162 END AS "All Time: Appointment booked",
1163 CASE
1164 WHEN (("gig_vs"."status")::"text" = 'sale complete'::"text") THEN 1
1165 ELSE 0
1166 END AS "Sale complete",
1167 CASE
1168 WHEN (("gig_vs"."status")::"text" = 'uncontactable'::"text") THEN 1
1169 ELSE 0
1170 END AS "Uncontactable",
1171 CASE
1172 WHEN (("gig_vs"."status")::"text" = 'invalid'::"text") THEN 1
1173 ELSE 0
1174 END AS "Invalid",
1175 'Get It Gone'::character varying AS "New Partner Name",
1176 'true'::character varying AS "Auto Leads",
1177 0 AS "Estimated Sales",
1178 0 AS "Estimated Revenue",
1179 0 AS "Revenue"
1180 FROM (((((((((("public"."enquiries" "e"
1181 JOIN "public"."valuations" "gig_val" ON ((("gig_val"."enquiryId" = "e"."id") AND ("gig_val"."buyerId" = 9) AND ((("gig_val"."status")::"text" = 'success'::"text") OR (("gig_val"."status")::"text" = 'no-valuation-data'::"text")))))
1182 JOIN "valstatuses" "gig_vs" ON (("gig_val"."id" = "gig_vs"."valuationId")))
1183 LEFT JOIN "public"."customers" "c" ON (("c"."id" = "e"."customerId")))
1184 LEFT JOIN "public"."vehicles" "v" ON (("v"."id" = "e"."vehicleId")))
1185 LEFT JOIN "public"."models" "mod" ON (("mod"."id" = "v"."modelId")))
1186 LEFT JOIN "public"."makes" "m" ON (("m"."id" = "v"."makeId")))
1187 LEFT JOIN "public"."valuations" "val" ON (("val"."enquiryId" = "e"."id")))
1188 LEFT JOIN "public"."buyers" "b" ON (("b"."id" = "val"."buyerId")))
1189 RIGHT JOIN "public"."eligibilities" "el" ON (("e"."id" = "el"."enquiryId")))
1190 LEFT JOIN "public"."eligibility_rules" "elr" ON (("el"."ruleId" = "elr"."id")))
1191 WHERE ("e"."createdAt" >= '2018-04-01 00:00:00+00'::timestamp with time zone)
1192 GROUP BY "e"."id", (("e"."createdAt")::"date"), "gig_vs"."status", "e"."tcbg_status", "v"."colour", "v"."engine_size", "m"."display_name", "v"."model", "mod"."name", "v"."body", "v"."fuel", ("e"."mileage" || ''::"text"), ("v"."year" || ''::"text"), "v"."transmission";
1193
1194
1195
1196pg_restore: creating SEQUENCE "public.postcodes_id_seq"
1197pg_restore: [archiver (db)] Error from TOC entry 302; 1259 16678 SEQUENCE postcodes_id_seq u6hvindjrfu37i
1198pg_restore: [archiver (db)] could not execute query: ERROR: relation "postcodes_id_seq" already exists
1199 Command was: CREATE SEQUENCE "public"."postcodes_id_seq"
1200 START WITH 1
1201 INCREMENT BY 1
1202 NO MINVALUE
1203 NO MAXVALUE
1204 CACHE 1;
1205
1206
1207
1208pg_restore: creating TABLE "public.postcodes"
1209pg_restore: [archiver (db)] Error from TOC entry 303; 1259 16680 TABLE postcodes u6hvindjrfu37i
1210pg_restore: [archiver (db)] could not execute query: ERROR: relation "postcodes" already exists
1211 Command was: CREATE TABLE "public"."postcodes" (
1212 "id" integer DEFAULT "nextval"('"public"."postcodes_id_seq"'::"regclass") NOT NULL,
1213 "value" character varying(255) NOT NULL,
1214 "createdAt" timestamp with time zone NOT NULL,
1215 "updatedAt" timestamp with time zone NOT NULL,
1216 "lat" double precision,
1217 "lng" double precision,
1218 "town" character varying(255),
1219 "area" character varying(255),
1220 "unmappable" boolean DEFAULT false
1221);
1222
1223
1224
1225pg_restore: creating TABLE "public.sales_data"
1226pg_restore: creating VIEW "public.tcbg_passive"
1227pg_restore: [archiver (db)] Error from TOC entry 330; 1259 634758 VIEW tcbg_passive u6hvindjrfu37i
1228pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.enquiries" does not exist
1229LINE 42: FROM (((("public"."enquiries" "e"
1230 ^
1231 Command was: CREATE VIEW "public"."tcbg_passive" AS
1232 SELECT ("e"."createdAt")::"date" AS "Date",
1233 'The Car Buying Group Passive'::character varying AS "Partner Name",
1234 'sent'::character varying AS "tcbg_status",
1235 "v"."colour",
1236 "v"."engine_size",
1237 "m"."display_name",
1238 "v"."model",
1239 "mod"."name",
1240 "v"."body",
1241 "v"."fuel",
1242 "e"."mileage",
1243 "v"."year",
1244 "v"."transmission",
1245 CASE
1246 WHEN (("b"."valuation" >= 0) AND ("b"."valuation" <= 499)) THEN '<500'::"text"
1247 WHEN (("b"."valuation" >= 500) AND ("b"."valuation" <= 999)) THEN '500-1000'::"text"
1248 WHEN (("b"."valuation" >= 1000) AND ("b"."valuation" <= 4999)) THEN '1-5k'::"text"
1249 WHEN (("b"."valuation" >= 5000) AND ("b"."valuation" <= 9999)) THEN '5- 10k'::"text"
1250 WHEN (("b"."valuation" >= 10000) AND ("b"."valuation" <= 14999)) THEN '10- 15k'::"text"
1251 WHEN (("b"."valuation" >= 15000) AND ("b"."valuation" <= 19999)) THEN '15- 20k'::"text"
1252 WHEN (("b"."valuation" >= 20000) AND ("b"."valuation" <= 29999)) THEN '20- 30k'::"text"
1253 WHEN (("b"."valuation" >= 30000) AND ("b"."valuation" <= 39999)) THEN '30- 40k'::"text"
1254 WHEN (("b"."valuation" >= 40000) AND ("b"."valuation" <= 49999)) THEN '40- 50k'::"text"
1255 WHEN ("b"."valuation" > 50000) THEN '50+'::"text"
1256 ELSE 'Non-numerical'::"text"
1257 END AS "Valuation Fork",
1258 "count"("e"."id") AS "All Time Offer selected",
1259 0 AS "Latest Status: Offer selected",
1260 0 AS "Offer rejected",
1261 0 AS "Appointment attended",
1262 0 AS "Latest Status: Appointment booked",
1263 0 AS "All Time: Appointment booked",
1264 0 AS "Sale complete",
1265 0 AS "Uncontactable",
1266 0 AS "Invalid",
1267 'The Car Buying Group Passive'::character varying AS "New Partner Name",
1268 'true'::character varying AS "Auto Leads",
1269 0 AS "Estimated Sales",
1270 0 AS "Estimated Revenue",
1271 0 AS "Revenue"
1272 FROM (((("public"."enquiries" "e"
1273 LEFT JOIN "public"."vehicles" "v" ON (("v"."id" = "e"."vehicleId")))
1274 LEFT JOIN ( SELECT "valuations"."enquiryId",
1275 "max"("valuations"."valuation") AS "valuation"
1276 FROM "public"."valuations"
1277 GROUP BY "valuations"."enquiryId") "b" ON (("e"."id" = "b"."enquiryId")))
1278 LEFT JOIN "public"."makes" "m" ON (("m"."id" = "v"."makeId")))
1279 LEFT JOIN "public"."models" "mod" ON (("mod"."id" = "v"."modelId")))
1280 WHERE (("e"."tcbg_status")::"text" = 'sent'::"text")
1281 GROUP BY (("e"."createdAt")::"date"), "v"."colour", "v"."engine_size", "v"."fuel", "m"."display_name", "v"."model", "mod"."name", "v"."body", "e"."mileage", "v"."year", "v"."transmission",
1282 CASE
1283 WHEN (("b"."valuation" >= 0) AND ("b"."valuation" <= 499)) THEN '<500'::"text"
1284 WHEN (("b"."valuation" >= 500) AND ("b"."valuation" <= 999)) THEN '500-1000'::"text"
1285 WHEN (("b"."valuation" >= 1000) AND ("b"."valuation" <= 4999)) THEN '1-5k'::"text"
1286 WHEN (("b"."valuation" >= 5000) AND ("b"."valuation" <= 9999)) THEN '5- 10k'::"text"
1287 WHEN (("b"."valuation" >= 10000) AND ("b"."valuation" <= 14999)) THEN '10- 15k'::"text"
1288 WHEN (("b"."valuation" >= 15000) AND ("b"."valuation" <= 19999)) THEN '15- 20k'::"text"
1289 WHEN (("b"."valuation" >= 20000) AND ("b"."valuation" <= 29999)) THEN '20- 30k'::"text"
1290 WHEN (("b"."valuation" >= 30000) AND ("b"."valuation" <= 39999)) THEN '30- 40k'::"text"
1291 WHEN (("b"."valuation" >= 40000) AND ("b"."valuation" <= 49999)) THEN '40- 50k'::"text"
1292 WHEN ("b"."valuation" > 50000) THEN '50+'::"text"
1293 ELSE 'Non-numerical'::"text"
1294 END;
1295
1296
1297
1298pg_restore: creating DEFAULT "public.affiliates id"
1299pg_restore: creating DEFAULT "public.eligibilities id"
1300pg_restore: creating DEFAULT "public.eligibility_rules id"
1301pg_restore: creating DEFAULT "public.model_variants id"
1302pg_restore: creating DEFAULT "public.models id"
1303pg_restore: processing data for table "public.SequelizeMeta"
1304pg_restore: processing data for table "public.affiliates"
1305pg_restore: executing SEQUENCE SET affiliates_id_seq
1306pg_restore: processing data for table "public.branch_postcodes"
1307pg_restore: processing data for table "public.branches"
1308pg_restore: executing SEQUENCE SET branches_id_seq
1309pg_restore: processing data for table "public.buyers"
1310pg_restore: processing data for table "public.customer_feedback"
1311pg_restore: processing data for table "public.customers"
1312pg_restore: executing SEQUENCE SET customers_id_seq
1313pg_restore: processing data for table "public.eligibilities"
1314pg_restore: executing SEQUENCE SET eligibilities_id_seq
1315pg_restore: processing data for table "public.eligibility_rules"
1316pg_restore: executing SEQUENCE SET eligibility_rules_id_seq
1317pg_restore: processing data for table "public.enquiries"
1318pg_restore: [archiver (db)] Error from TOC entry 3600; 0 16652 TABLE DATA enquiries u6hvindjrfu37i
1319pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.enquiries" does not exist
1320 Command was: COPY "public"."enquiries" ("id", "mileage", "mileage_est", "mileage_last_mot", "createdAt", "updatedAt", "customerId", "vehicleId", "vehicle_removed", "sent_to_ga", "tcbg_status", "affiliateId", "status", "valuation_reason", "new_car_status", "app_variant") FROM stdin;
1321
1322pg_restore: executing SEQUENCE SET enquiries_id_seq
1323pg_restore: executing SEQUENCE SET gen_models_id_seq
1324pg_restore: executing SEQUENCE SET gov_models_id_seq
1325pg_restore: processing data for table "public.makes"
1326pg_restore: executing SEQUENCE SET makes_id_seq
1327pg_restore: processing data for table "public.model_variants"
1328pg_restore: processing data for table "public.models"
1329pg_restore: executing SEQUENCE SET partners_id_seq
1330pg_restore: processing data for table "public.postcodes"
1331pg_restore: executing SEQUENCE SET postcodes_id_seq
1332pg_restore: processing data for table "public.sales_data"
1333pg_restore: processing data for table "public.tracking_data"
1334pg_restore: processing data for table "public.valuation_states"
1335pg_restore: executing SEQUENCE SET valuation_status_histories_id_seq
1336pg_restore: processing data for table "public.valuations"
1337pg_restore: executing SEQUENCE SET valuations_id_seq
1338pg_restore: processing data for table "public.vehicles"
1339pg_restore: executing SEQUENCE SET vehicles_id_seq
1340pg_restore: creating CONSTRAINT "public.SequelizeMeta SequelizeMeta_pkey"
1341pg_restore: creating CONSTRAINT "public.affiliates affiliates_pkey"
1342pg_restore: creating CONSTRAINT "public.affiliates affiliates_slug_key"
1343pg_restore: creating CONSTRAINT "public.branch_postcodes branch_postcodes_pkey"
1344pg_restore: creating CONSTRAINT "public.branches branches_pkey"
1345pg_restore: creating CONSTRAINT "public.customers customer_email_key"
1346pg_restore: creating CONSTRAINT "public.customer_feedback customer_feedback_pkey"
1347pg_restore: creating CONSTRAINT "public.customers customers_pkey"
1348pg_restore: creating CONSTRAINT "public.eligibilities eligibilities_pkey"
1349pg_restore: creating CONSTRAINT "public.eligibility_rules eligibility_rules_pkey"
1350pg_restore: creating CONSTRAINT "public.enquiries enquiries_pkey"
1351pg_restore: [archiver (db)] Error from TOC entry 3418; 2606 16735 CONSTRAINT enquiries enquiries_pkey u6hvindjrfu37i
1352pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.enquiries" does not exist
1353 Command was: ALTER TABLE ONLY "public"."enquiries"
1354 ADD CONSTRAINT "enquiries_pkey" PRIMARY KEY ("id");
1355
1356
1357
1358pg_restore: creating CONSTRAINT "public.models gen_models_pkey"
1359pg_restore: creating CONSTRAINT "public.model_variants gov_models_pkey"
1360pg_restore: creating CONSTRAINT "public.makes makes_map_id_key"
1361pg_restore: creating CONSTRAINT "public.makes makes_pkey"
1362pg_restore: creating CONSTRAINT "public.buyers partners_pkey"
1363pg_restore: [archiver (db)] Error from TOC entry 3424; 2606 16741 CONSTRAINT buyers partners_pkey u6hvindjrfu37i
1364pg_restore: [archiver (db)] could not execute query: ERROR: multiple primary keys for table "buyers" are not allowed
1365 Command was: ALTER TABLE ONLY "public"."buyers"
1366 ADD CONSTRAINT "partners_pkey" PRIMARY KEY ("id");
1367
1368
1369
1370pg_restore: creating CONSTRAINT "public.buyers partners_slug_key"
1371pg_restore: [archiver (db)] Error from TOC entry 3426; 2606 16743 CONSTRAINT buyers partners_slug_key u6hvindjrfu37i
1372pg_restore: [archiver (db)] could not execute query: ERROR: relation "partners_slug_key" already exists
1373 Command was: ALTER TABLE ONLY "public"."buyers"
1374 ADD CONSTRAINT "partners_slug_key" UNIQUE ("slug");
1375
1376
1377
1378pg_restore: creating CONSTRAINT "public.postcodes postcodes_pkey"
1379pg_restore: creating CONSTRAINT "public.postcodes postcodes_value_key"
1380pg_restore: [archiver (db)] Error from TOC entry 3430; 2606 16747 CONSTRAINT postcodes postcodes_value_key u6hvindjrfu37i
1381pg_restore: [archiver (db)] could not execute query: ERROR: relation "postcodes_value_key" already exists
1382 Command was: ALTER TABLE ONLY "public"."postcodes"
1383 ADD CONSTRAINT "postcodes_value_key" UNIQUE ("value");
1384
1385
1386
1387pg_restore: creating CONSTRAINT "public.sales_data sales_data_pkey"
1388pg_restore: creating CONSTRAINT "public.valuation_states valuation_status_histories_pkey"
1389pg_restore: [archiver (db)] Error from TOC entry 3432; 2606 16749 CONSTRAINT valuation_states valuation_status_histories_pkey u6hvindjrfu37i
1390pg_restore: [archiver (db)] could not execute query: ERROR: relation "valuation_status_histories_pkey" already exists
1391 Command was: ALTER TABLE ONLY "public"."valuation_states"
1392 ADD CONSTRAINT "valuation_status_histories_pkey" PRIMARY KEY ("id");
1393
1394
1395
1396pg_restore: creating CONSTRAINT "public.valuations valuations_pkey"
1397pg_restore: creating CONSTRAINT "public.vehicles vehicles_pkey"
1398pg_restore: creating INDEX "public.customers_login_token"
1399pg_restore: creating INDEX "public.gov_models_make_id_name"
1400pg_restore: creating INDEX "public.valuation_status_histories_valuationid"
1401pg_restore: creating TRIGGER "public.buyers updated_partners_trigger"
1402pg_restore: [archiver (db)] Error from TOC entry 3468; 2620 94695 TRIGGER buyers updated_partners_trigger u6hvindjrfu37i
1403pg_restore: [archiver (db)] could not execute query: ERROR: function public.partners_notify() does not exist
1404 Command was: CREATE TRIGGER "updated_partners_trigger" AFTER UPDATE ON "public"."buyers" FOR EACH ROW EXECUTE PROCEDURE "public"."partners_notify"();
1405
1406
1407
1408pg_restore: creating TRIGGER "public.eligibility_rules updated_rules_trigger"
1409pg_restore: [archiver (db)] Error from TOC entry 3469; 2620 176548 TRIGGER eligibility_rules updated_rules_trigger u6hvindjrfu37i
1410pg_restore: [archiver (db)] could not execute query: ERROR: function public.rules_notify() does not exist
1411 Command was: CREATE TRIGGER "updated_rules_trigger" AFTER INSERT OR DELETE OR UPDATE ON "public"."eligibility_rules" FOR EACH ROW EXECUTE PROCEDURE "public"."rules_notify"();
1412
1413
1414
1415pg_restore: creating FK CONSTRAINT "public.branch_postcodes branch_postcodes_branchId_fkey"
1416pg_restore: creating FK CONSTRAINT "public.branch_postcodes branch_postcodes_postcodeId_fkey"
1417pg_restore: creating FK CONSTRAINT "public.branches branches_partnerId_fkey"
1418pg_restore: creating FK CONSTRAINT "public.customer_feedback customer_feedback_enquiryId_fkey"
1419pg_restore: [archiver (db)] Error from TOC entry 3466; 2606 299265 FK CONSTRAINT customer_feedback customer_feedback_enquiryId_fkey u6hvindjrfu37i
1420pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.enquiries" does not exist
1421 Command was: ALTER TABLE ONLY "public"."customer_feedback"
1422 ADD CONSTRAINT "customer_feedback_enquiryId_fkey" FOREIGN KEY ("enquiryId") REFERENCES "public"."enquiries"("id") ON UPDATE CASCADE;
1423
1424
1425
1426pg_restore: creating FK CONSTRAINT "public.customer_feedback customer_feedback_partnerId_fkey"
1427pg_restore: creating FK CONSTRAINT "public.enquiries enquiries_customerId_fkey"
1428pg_restore: [archiver (db)] Error from TOC entry 3460; 2606 16769 FK CONSTRAINT enquiries enquiries_customerId_fkey u6hvindjrfu37i
1429pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.enquiries" does not exist
1430 Command was: ALTER TABLE ONLY "public"."enquiries"
1431 ADD CONSTRAINT "enquiries_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "public"."customers"("id");
1432
1433
1434
1435pg_restore: creating FK CONSTRAINT "public.enquiries enquiries_vehicleId_fkey"
1436pg_restore: [archiver (db)] Error from TOC entry 3461; 2606 16774 FK CONSTRAINT enquiries enquiries_vehicleId_fkey u6hvindjrfu37i
1437pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.enquiries" does not exist
1438 Command was: ALTER TABLE ONLY "public"."enquiries"
1439 ADD CONSTRAINT "enquiries_vehicleId_fkey" FOREIGN KEY ("vehicleId") REFERENCES "public"."vehicles"("id");
1440
1441
1442
1443pg_restore: creating FK CONSTRAINT "public.valuation_states valuation_states_valuationId_fkey"
1444pg_restore: creating FK CONSTRAINT "public.valuations valuations_enquiryId_fkey"
1445pg_restore: [archiver (db)] Error from TOC entry 3463; 2606 16784 FK CONSTRAINT valuations valuations_enquiryId_fkey u6hvindjrfu37i
1446pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.enquiries" does not exist
1447 Command was: ALTER TABLE ONLY "public"."valuations"
1448 ADD CONSTRAINT "valuations_enquiryId_fkey" FOREIGN KEY ("enquiryId") REFERENCES "public"."enquiries"("id");
1449
1450
1451
1452pg_restore: creating FK CONSTRAINT "public.valuations valuations_partnerId_fkey"
1453pg_restore: creating FK CONSTRAINT "public.vehicles vehicles_makeId_fkey"
1454WARNING: errors ignored on restore: 108