forked from jacamars/Newbidder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostgres.sql
More file actions
1298 lines (894 loc) · 38.7 KB
/
postgres.sql
File metadata and controls
1298 lines (894 loc) · 38.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.10
-- Dumped by pg_dump version 9.6.10
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: DATABASE postgres; Type: COMMENT; Schema: -; Owner: postgres
--
COMMENT ON DATABASE postgres IS 'default administrative connection database';
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: attachments; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.attachments (
id integer NOT NULL,
filename character varying(255) DEFAULT NULL::character varying,
content_type character varying(255) DEFAULT NULL::character varying,
data bytea,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
ALTER TABLE public.attachments OWNER TO postgres;
--
-- Name: attachments_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.attachments_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.attachments_id_seq OWNER TO postgres;
--
-- Name: attachments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.attachments_id_seq OWNED BY public.attachments.id;
--
-- Name: banner_videos; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.banner_videos (
id integer NOT NULL,
campaign_id integer,
interval_start timestamp without time zone,
interval_end timestamp without time zone,
total_basket_value numeric(15,6) DEFAULT NULL::numeric,
total_budget numeric(15,6) DEFAULT NULL::numeric,
vast_video_width integer,
vast_video_height integer,
bid_ecpm numeric,
vast_video_linerarity integer,
vast_video_duration integer,
vast_video_type text,
vast_video_outgoing_file text,
bids integer,
clicks integer,
pixels integer,
wins integer,
total_cost numeric DEFAULT 0.000000,
daily_cost numeric,
daily_budget numeric,
frequency_spec text,
frequency_expire integer,
frequency_count integer,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
hourly_budget numeric,
name character varying(256) DEFAULT NULL::character varying,
target_id integer,
hourly_cost numeric,
bitrate integer,
mime_type character varying(255) DEFAULT NULL::character varying,
deals character varying(255) DEFAULT NULL::character varying,
width_range character varying(255) DEFAULT NULL::character varying,
height_range character varying(255) DEFAULT NULL::character varying,
width_height_list character varying(255) DEFAULT NULL::character varying
);
ALTER TABLE public.banner_videos OWNER TO postgres;
--
-- Name: banner_videos_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.banner_videos_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.banner_videos_id_seq OWNER TO postgres;
--
-- Name: banner_videos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.banner_videos_id_seq OWNED BY public.banner_videos.id;
--
-- Name: banner_videos_rtb_standards; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.banner_videos_rtb_standards (
banner_video_id integer NOT NULL,
rtb_standard_id integer
);
ALTER TABLE public.banner_videos_rtb_standards OWNER TO postgres;
--
-- Name: banner_videos_rtb_standards_banner_video_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.banner_videos_rtb_standards_banner_video_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.banner_videos_rtb_standards_banner_video_id_seq OWNER TO postgres;
--
-- Name: banner_videos_rtb_standards_banner_video_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.banner_videos_rtb_standards_banner_video_id_seq OWNED BY public.banner_videos_rtb_standards.banner_video_id;
--
-- Name: banners; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.banners (
id integer NOT NULL,
campaign_id integer,
interval_start timestamp without time zone NOT NULL,
interval_end timestamp without time zone,
total_basket_value numeric,
width integer,
height integer,
bid_ecpm numeric(15,6) DEFAULT NULL::numeric,
total_cost numeric(15,6) DEFAULT NULL::numeric,
contenttype character varying(1024) DEFAULT NULL::character varying,
iurl character varying(1024) DEFAULT NULL::character varying,
htmltemplate text,
bids integer,
clicks integer,
pixels integer,
wins integer,
daily_budget numeric(15,6) DEFAULT NULL::numeric,
hourly_budget numeric(15,6) DEFAULT NULL::numeric,
daily_cost numeric(15,6) DEFAULT NULL::numeric,
target_id integer,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
name character varying(255) DEFAULT NULL::character varying,
frequency_spec character varying(255) DEFAULT NULL::character varying,
frequency_expire integer,
frequency_count integer,
hourly_cost numeric(15,6) DEFAULT NULL::numeric,
deals character varying(255) DEFAULT NULL::character varying,
width_range character varying(255) DEFAULT NULL::character varying,
height_range character varying(255) DEFAULT NULL::character varying,
width_height_list character varying(255) DEFAULT NULL::character varying
);
ALTER TABLE public.banners OWNER TO postgres;
--
-- Name: banners_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.banners_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.banners_id_seq OWNER TO postgres;
--
-- Name: banners_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.banners_id_seq OWNED BY public.banners.id;
--
-- Name: banners_rtb_standards; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.banners_rtb_standards (
banner_id integer NOT NULL,
rtb_standard_id integer
);
ALTER TABLE public.banners_rtb_standards OWNER TO postgres;
--
-- Name: banners_rtb_standards_banner_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.banners_rtb_standards_banner_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.banners_rtb_standards_banner_id_seq OWNER TO postgres;
--
-- Name: banners_rtb_standards_banner_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.banners_rtb_standards_banner_id_seq OWNED BY public.banners_rtb_standards.banner_id;
--
-- Name: campaigns; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.campaigns (
id integer NOT NULL,
activate_time timestamp without time zone,
expire_time timestamp without time zone,
cost numeric(15,6) DEFAULT NULL::numeric,
ad_domain character varying(1024) DEFAULT NULL::character varying,
clicks integer,
pixels integer,
wins integer,
bids integer,
name character varying(1024) DEFAULT NULL::character varying,
status character varying(1024) DEFAULT NULL::character varying,
conversion_type character varying(1024) DEFAULT NULL::character varying,
budget_limit_daily numeric(15,6) DEFAULT NULL::numeric,
budget_limit_hourly numeric(15,6) DEFAULT NULL::numeric,
total_budget numeric(15,6) DEFAULT NULL::numeric,
bid numeric(15,6) DEFAULT NULL::numeric,
shard text,
forensiq text,
daily_cost numeric(15,6) DEFAULT NULL::numeric,
updated_at timestamp without time zone,
deleted_at timestamp without time zone,
created_at timestamp without time zone,
hourly_cost numeric(15,6) DEFAULT NULL::numeric,
exchanges character varying(255) DEFAULT NULL::character varying,
regions character varying(255) DEFAULT NULL::character varying,
target_id integer
);
ALTER TABLE public.campaigns OWNER TO postgres;
--
-- Name: campaigns_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.campaigns_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.campaigns_id_seq OWNER TO postgres;
--
-- Name: campaigns_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.campaigns_id_seq OWNED BY public.campaigns.id;
--
-- Name: campaigns_rtb_standards; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.campaigns_rtb_standards (
campaign_id integer NOT NULL,
rtb_standard_id integer
);
ALTER TABLE public.campaigns_rtb_standards OWNER TO postgres;
--
-- Name: campaigns_rtb_standards_campaign_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.campaigns_rtb_standards_campaign_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.campaigns_rtb_standards_campaign_id_seq OWNER TO postgres;
--
-- Name: campaigns_rtb_standards_campaign_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.campaigns_rtb_standards_campaign_id_seq OWNED BY public.campaigns_rtb_standards.campaign_id;
--
-- Name: categories; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.categories (
id integer NOT NULL,
name character varying(1024) DEFAULT NULL::character varying,
description character varying(2048) DEFAULT NULL::character varying,
updated_at timestamp without time zone,
created_at timestamp without time zone
);
ALTER TABLE public.categories OWNER TO postgres;
--
-- Name: categories_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.categories_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.categories_id_seq OWNER TO postgres;
--
-- Name: categories_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.categories_id_seq OWNED BY public.categories.id;
--
-- Name: countries; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.countries (
id integer NOT NULL,
sort_order character varying(255) DEFAULT NULL::character varying,
common_name character varying(255) DEFAULT NULL::character varying,
formal_name character varying(255) DEFAULT NULL::character varying,
country_type character varying(255) DEFAULT NULL::character varying,
sub_type character varying(255) DEFAULT NULL::character varying,
sovereignty character varying(255) DEFAULT NULL::character varying,
capital character varying(255) DEFAULT NULL::character varying,
iso_4217_currency_code character varying(255) DEFAULT NULL::character varying,
iso_4217_currency_name character varying(255) DEFAULT NULL::character varying,
"itu-t_telephone_code" character varying(255) DEFAULT NULL::character varying,
"iso_3166-1_2_letter_code" character varying(255) DEFAULT NULL::character varying,
"iso_3166-1_3_letter_code" character varying(255) DEFAULT NULL::character varying,
"iso_3166-1_number" character varying(255) DEFAULT NULL::character varying,
iana_country_code_tld character varying(255) DEFAULT NULL::character varying
);
ALTER TABLE public.countries OWNER TO postgres;
--
-- Name: countries_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.countries_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.countries_id_seq OWNER TO postgres;
--
-- Name: countries_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.countries_id_seq OWNED BY public.countries.id;
--
-- Name: exchange_attributes; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.exchange_attributes (
id integer NOT NULL,
banner_id integer,
banner_video_id integer,
name character varying(255) DEFAULT NULL::character varying,
value character varying(255) DEFAULT NULL::character varying,
created_at timestamp without time zone,
updated_at timestamp without time zone,
exchange character varying(255) DEFAULT NULL::character varying
);
ALTER TABLE public.exchange_attributes OWNER TO postgres;
--
-- Name: exchange_attributes_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.exchange_attributes_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.exchange_attributes_id_seq OWNER TO postgres;
--
-- Name: exchange_attributes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.exchange_attributes_id_seq OWNED BY public.exchange_attributes.id;
--
-- Name: exchange_rtbspecs; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.exchange_rtbspecs (
id integer NOT NULL,
rtbspecification character varying(1024) DEFAULT NULL::character varying,
operand_type character varying(1024) DEFAULT NULL::character varying,
operand_ordinal character varying(1024) DEFAULT NULL::character varying,
updated_at timestamp without time zone,
deleted_at timestamp without time zone
);
ALTER TABLE public.exchange_rtbspecs OWNER TO postgres;
--
-- Name: exchange_rtbspecs_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.exchange_rtbspecs_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.exchange_rtbspecs_id_seq OWNER TO postgres;
--
-- Name: exchange_rtbspecs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.exchange_rtbspecs_id_seq OWNED BY public.exchange_rtbspecs.id;
--
-- Name: iab_categories; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.iab_categories (
id integer NOT NULL,
"group" text,
name text,
iab_id text,
is_group integer,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
ALTER TABLE public.iab_categories OWNER TO postgres;
--
-- Name: iab_categories_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.iab_categories_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.iab_categories_id_seq OWNER TO postgres;
--
-- Name: iab_categories_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.iab_categories_id_seq OWNED BY public.iab_categories.id;
--
-- Name: lists; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.lists (
id integer NOT NULL,
name character varying(1024) DEFAULT NULL::character varying,
description character varying(4096) DEFAULT NULL::character varying,
list_type character varying(1024) DEFAULT NULL::character varying,
filesize integer,
s3_url character varying(4096) DEFAULT NULL::character varying,
filepath character varying(4096) DEFAULT NULL::character varying,
filetype character varying(4096) DEFAULT NULL::character varying,
last_modified character varying(1024) DEFAULT NULL::character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
ALTER TABLE public.lists OWNER TO postgres;
--
-- Name: lists_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.lists_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.lists_id_seq OWNER TO postgres;
--
-- Name: lists_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.lists_id_seq OWNED BY public.lists.id;
--
-- Name: misc; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.misc (
id text NOT NULL,
value text NOT NULL,
endtime bigint NOT NULL
);
ALTER TABLE public.misc OWNER TO postgres;
--
-- Name: recordedbids; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.recordedbids (
id text NOT NULL,
capkey text NOT NULL,
captimeout bigint NOT NULL,
captimeunit text NOT NULL,
price text NOT NULL,
adtype text NOT NULL,
frequencycap text NOT NULL,
endtime bigint NOT NULL
);
ALTER TABLE public.recordedbids OWNER TO postgres;
--
-- Name: report_commands; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.report_commands (
id integer NOT NULL,
name character varying(1024) DEFAULT NULL::character varying,
type character varying(1024) DEFAULT NULL::character varying,
campaign_id integer,
description character varying(2048) DEFAULT NULL::character varying,
command text,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
banner_id integer,
banner_video_id integer
);
ALTER TABLE public.report_commands OWNER TO postgres;
--
-- Name: report_commands_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.report_commands_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.report_commands_id_seq OWNER TO postgres;
--
-- Name: report_commands_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.report_commands_id_seq OWNED BY public.report_commands.id;
--
-- Name: rtb_standards; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.rtb_standards (
id integer NOT NULL,
rtbspecification character varying(1024) DEFAULT NULL::character varying,
operator character varying(1024) DEFAULT NULL::character varying,
operand character varying(1024) DEFAULT NULL::character varying,
operand_type character varying(16) DEFAULT NULL::character varying,
operand_ordinal character varying(16) DEFAULT NULL::character varying,
rtb_required integer,
name character varying(255) DEFAULT NULL::character varying,
description character varying(255) DEFAULT NULL::character varying,
created_at timestamp without time zone,
updated_at timestamp without time zone,
operand_list_id integer
);
ALTER TABLE public.rtb_standards OWNER TO postgres;
--
-- Name: rtb_standards_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.rtb_standards_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.rtb_standards_id_seq OWNER TO postgres;
--
-- Name: rtb_standards_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.rtb_standards_id_seq OWNED BY public.rtb_standards.id;
--
-- Name: targets; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.targets (
id integer NOT NULL,
activate_time timestamp without time zone,
expire_time timestamp without time zone,
list_of_domains text,
domain_targetting text,
geo_latitude numeric,
geo_longitude numeric,
geo_range numeric,
country text,
geo_region text,
carrier text,
os text,
make text,
model text,
devicetype text,
iab_category text,
iab_category_blklist text,
created_at timestamp without time zone,
updated_at timestamp without time zone,
name text
);
ALTER TABLE public.targets OWNER TO postgres;
--
-- Name: targets_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.targets_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.targets_id_seq OWNER TO postgres;
--
-- Name: targets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.targets_id_seq OWNED BY public.targets.id;
--
-- Name: video; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.video (
id text NOT NULL,
name text,
endtime bigint NOT NULL
);
ALTER TABLE public.video OWNER TO postgres;
--
-- Name: attachments id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.attachments ALTER COLUMN id SET DEFAULT nextval('public.attachments_id_seq'::regclass);
--
-- Name: banner_videos id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.banner_videos ALTER COLUMN id SET DEFAULT nextval('public.banner_videos_id_seq'::regclass);
--
-- Name: banner_videos_rtb_standards banner_video_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.banner_videos_rtb_standards ALTER COLUMN banner_video_id SET DEFAULT nextval('public.banner_videos_rtb_standards_banner_video_id_seq'::regclass);
--
-- Name: banners id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.banners ALTER COLUMN id SET DEFAULT nextval('public.banners_id_seq'::regclass);
--
-- Name: banners_rtb_standards banner_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.banners_rtb_standards ALTER COLUMN banner_id SET DEFAULT nextval('public.banners_rtb_standards_banner_id_seq'::regclass);
--
-- Name: campaigns id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.campaigns ALTER COLUMN id SET DEFAULT nextval('public.campaigns_id_seq'::regclass);
--
-- Name: campaigns_rtb_standards campaign_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.campaigns_rtb_standards ALTER COLUMN campaign_id SET DEFAULT nextval('public.campaigns_rtb_standards_campaign_id_seq'::regclass);
--
-- Name: categories id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.categories ALTER COLUMN id SET DEFAULT nextval('public.categories_id_seq'::regclass);
--
-- Name: countries id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.countries ALTER COLUMN id SET DEFAULT nextval('public.countries_id_seq'::regclass);
--
-- Name: exchange_attributes id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.exchange_attributes ALTER COLUMN id SET DEFAULT nextval('public.exchange_attributes_id_seq'::regclass);
--
-- Name: exchange_rtbspecs id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.exchange_rtbspecs ALTER COLUMN id SET DEFAULT nextval('public.exchange_rtbspecs_id_seq'::regclass);
--
-- Name: iab_categories id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.iab_categories ALTER COLUMN id SET DEFAULT nextval('public.iab_categories_id_seq'::regclass);
--
-- Name: lists id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.lists ALTER COLUMN id SET DEFAULT nextval('public.lists_id_seq'::regclass);
--
-- Name: report_commands id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.report_commands ALTER COLUMN id SET DEFAULT nextval('public.report_commands_id_seq'::regclass);
--
-- Name: rtb_standards id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.rtb_standards ALTER COLUMN id SET DEFAULT nextval('public.rtb_standards_id_seq'::regclass);
--
-- Name: targets id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.targets ALTER COLUMN id SET DEFAULT nextval('public.targets_id_seq'::regclass);
--
-- Data for Name: attachments; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.attachments (id, filename, content_type, data, created_at, updated_at) FROM stdin;
\.
--
-- Name: attachments_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.attachments_id_seq', 1, false);
--
-- Data for Name: banner_videos; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.banner_videos (id, campaign_id, interval_start, interval_end, total_basket_value, total_budget, vast_video_width, vast_video_height, bid_ecpm, vast_video_linerarity, vast_video_duration, vast_video_type, vast_video_outgoing_file, bids, clicks, pixels, wins, total_cost, daily_cost, daily_budget, frequency_spec, frequency_expire, frequency_count, created_at, updated_at, hourly_budget, name, target_id, hourly_cost, bitrate, mime_type, deals, width_range, height_range, width_height_list) FROM stdin;
5 2 2018-01-01 00:00:00 2020-01-01 00:00:00 \N \N 400 200 1.000000 1 50 5 <VAST xmlns:xsi=\\"http://www.w3.org/2001/XMLSchema-instance\\" version=\\"2.0\\" xsi:noNamespaceSchemaLocation=\\"vast.xsd\\">\\r\\n<Ad id=\\"270\\" >\\r\\n<InLine>\\r\\n<AdSystem version=\\"2.0\\">ONION</AdSystem>\\r\\n<AdTitle>In-Stream Video</AdTitle>\\r\\n<Description>Cottonelle Video Skin 7/15</Description>\\r\\n<Impression><![CDATA[https://ad.doubleclick.net/ad/N3186.3804.ONIONINC/B8043482.3;sz=1x1;pc=[TPAS_ID];ord=%%CACHEBUSTER%%?]]></Impression>
\\r\\n<Impression><![CDATA[http://influxer.onion.com/influx.gif?site=onionads&event=impression&content_id=270&path=/vast/270.xml]]></Impression>
\\r\\n<Impression><![CDATA[http://ra.onion.com/video-ad.gif?video_ad=270&event=impression]]></Impression>\\r\\n<Impression><![CDATA[{pixel_url}/exchange={exchange}/ad_id={ad_id}/creative_id={creative_id}/price=${AUCTION_PRICE}/lat={lat}/lon={lon}/bid_id={bid_id}]]></Impression>
\\r\\n<Creatives>\\r\\n<Creative sequence=\\"1\\" AdID=\\"270\\">\\r\\n<Linear>\\r\\n<Duration>00:01:05</Duration>\\r\\n<TrackingEvents>\\r\\n<Tracking event=\\"start\\"><![CDATA[ http://influxer.onion.com/influx.gif?site=onionads&event=start&content_id=270&path=/vast/270.xml]]></Tracking>\\r\\n<Tracking event=\\"start\\"><![CDATA[ http://ra.onion.com/video-ad.gif?video_ad=270&event=start]]></Tracking>\\r\\n<Tracking event=\\"firstQuartile\\"><![CDATA[ http://influxer.onion.com/influx.gif?site=onionads&event=firstQuartile&content_id=270&path=/vast/270.xml ]]></Tracking>\\r\\n<Tracking event=\\"firstQuartile\\"><![CDATA[ http://ra.onion.com/video-ad.gif?video_ad=270&event=firstQuartile ]]></Tracking>\\r\\n<Tracking event=\\"midpoint\\"><![CDATA[ http://influxer.onion.com/influx.gif?site=onionads&event=midpoint&content_id=270&path=/vast/270.xml ]]></Tracking>\\r\\n<Tracking event=\\"midpoint\\"><![CDATA[ http://ra.onion.com/video-ad.gif?video_ad=270&event=midpoint ]]></Tracking>\\r\\n<Tracking event=\\"thirdQuartile\\"><![CDATA[ http://influxer.onion.com/influx.gif?site=onionads&event=thirdQuartile&content_id=270&path=/vast/270.xml ]]></Tracking>\\r\\n<Tracking event=\\"thirdQuartile\\"><![CDATA[ http://ra.onion.com/video-ad.gif?video_ad=270&event=thirdQuartile ]]></Tracking>\\r\\n<Tracking event=\\"complete\\"><![CDATA[ http://influxer.onion.com/influx.gif?site=onionads&event=complete&content_id=270&path=/vast/270.xml ]]></Tracking>\\r\\n<Tracking event=\\"complete\\"><![CDATA[ http://ra.onion.com/video-ad.gif?video_ad=270&event=complete ]]></Tracking>\\r\\n</TrackingEvents>\\r\\n<VideoClicks>\\r\\n<ClickThrough><![CDATA[https://ad.doubleclick.net/clk;281053485;107792520;e;pc=[TPAS_ID]]]></ClickThrough>\\r\\n</VideoClicks>\\r\\n<MediaFiles>\\r\\n<MediaFile delivery=\\"progressive\\" type=\\"video/webm\\" bitrate=\\"340\\" width=\\"640\\" height=\\"\\">\\r\\n<![CDATA[http://v.theonion.com/onionwebtech/videoads/525/sd.webm]]>\\r\\n</MediaFile>\\r\\n<MediaFile delivery=\\"progressive\\" type=\\"video/mp4\\" bitrate=\\"474\\" width=\\"640\\" height=\\"\\">\\r\\n<![CDATA[http://v.theonion.com/onionwebtech/videoads/525/sd.mp4]]>\\r\\n</MediaFile>\\r\\n<MediaFile delivery=\\"progressive\\" type=\\"application/x-mpegurl\\" bitrate=\\"None\\" width=\\"None\\" height=\\"\\">\\r\\n<![CDATA[http://v.theonion.com/onionwebtech/videoads/525/hls_playlist.m3u8]]>\\r\\n</MediaFile>\\r\\n</MediaFiles>\\r\\n</Linear>\\r\\n</Creative>\\r\\n</Creatives>\\r\\n</InLine>\\r\\n\\r\\n\\r\\n</Ad>\\r\\n</VAST> \N \N \N \N 0.000000 \N \N \N \N 2017-05-01 20:55:25 2018-04-18 21:29:41 \N Demo Video \N \N 2000 video/mp4 \N \N \N
1 1 2019-04-16 21:57:24.427943 2019-04-16 21:57:24.427943 \N \N 600 400 \N 2 120 \N your-vast-tag-goes-here \N \N \N \N 0.000000 \N \N \N \N \N 2019-04-16 21:57:24.427943 2019-04-16 21:57:24.427943 \N \N \N \N 64000 video/mpeg2 \N \N \N \N
\.
--
-- Name: banner_videos_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.banner_videos_id_seq', 1, true);
--
-- Data for Name: banner_videos_rtb_standards; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.banner_videos_rtb_standards (banner_video_id, rtb_standard_id) FROM stdin;
1 2
\.
--
-- Name: banner_videos_rtb_standards_banner_video_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.banner_videos_rtb_standards_banner_video_id_seq', 1, false);
--
-- Data for Name: banners; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.banners (id, campaign_id, interval_start, interval_end, total_basket_value, width, height, bid_ecpm, total_cost, contenttype, iurl, htmltemplate, bids, clicks, pixels, wins, daily_budget, hourly_budget, daily_cost, target_id, created_at, updated_at, name, frequency_spec, frequency_expire, frequency_count, hourly_cost, deals, width_range, height_range, width_height_list) FROM stdin;
1 1 2019-04-16 21:46:55.229768 2020-04-17 18:40:15.940911 \N 4 320 50.000000 \N image/jpeg \N <img src='http://localhost/www.test.jpeg'> \N \N \N \N \N \N \N \N 2019-04-16 21:46:55.229768 2019-04-16 21:46:55.229768 \N \N \N \N \N \N \N \N \N
\.
--
-- Name: banners_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.banners_id_seq', 1, true);
--
-- Data for Name: banners_rtb_standards; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.banners_rtb_standards (banner_id, rtb_standard_id) FROM stdin;
1 1
\.
--
-- Name: banners_rtb_standards_banner_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.banners_rtb_standards_banner_id_seq', 1, false);
--
-- Data for Name: campaigns; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.campaigns (id, activate_time, expire_time, cost, ad_domain, clicks, pixels, wins, bids, name, status, conversion_type, budget_limit_daily, budget_limit_hourly, total_budget, bid, shard, forensiq, daily_cost, updated_at, deleted_at, created_at, hourly_cost, exchanges, regions, target_id) FROM stdin;
1 2019-04-21 17:07:24.604862 2020-04-17 23:23:52.281295 \N \N \N \N \N \N \N runnable \N \N \N \N \N \N \N \N 2019-04-18 17:13:21.292308 \N 2019-04-16 22:01:44.451436 \N \N USA 1
\.
--
-- Name: campaigns_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.campaigns_id_seq', 1, true);
--
-- Data for Name: campaigns_rtb_standards; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.campaigns_rtb_standards (campaign_id, rtb_standard_id) FROM stdin;
\.
--
-- Name: campaigns_rtb_standards_campaign_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--