-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
structure.sql
2087 lines (1364 loc) · 53.2 KB
/
structure.sql
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
/* sudo -u postgres pg_dump phpshell -s */
--
-- PostgreSQL database dump
--
-- Dumped from database version 16.1
-- Dumped by pg_dump version 16.1
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 xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: public; Type: SCHEMA; Schema: -; Owner: postgres
--
-- *not* creating schema, since initdb creates it
ALTER SCHEMA public OWNER TO postgres;
--
-- Name: pg_repack; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS pg_repack WITH SCHEMA public;
--
-- Name: EXTENSION pg_repack; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION pg_repack IS 'Reorganize tables in PostgreSQL databases with minimal locks';
--
-- Name: pg_stat_statements; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS pg_stat_statements WITH SCHEMA public;
--
-- Name: EXTENSION pg_stat_statements; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION pg_stat_statements IS 'track execution statistics of all SQL statements executed';
--
-- Name: input_mutated(); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION public.input_mutated() RETURNS trigger
LANGUAGE plpgsql
AS $$ BEGIN UPDATE input SET "lastResultChange" = TIMEZONE('UTC'::text, NOW()) WHERE id=NEW.input; RETURN NEW; END; $$;
ALTER FUNCTION public.input_mutated() OWNER TO postgres;
--
-- Name: notify_daemon(); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION public.notify_daemon() RETURNS trigger
LANGUAGE plpgsql
AS $$BEGIN
PERFORM pg_notify('daemon', TG_ARGV[0]);
RETURN NEW;
END;
$$;
ALTER FUNCTION public.notify_daemon() OWNER TO postgres;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: assertion; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.assertion (
input integer NOT NULL,
"outputHash" character varying(28) NOT NULL,
"user" integer,
created timestamp without time zone DEFAULT timezone('UTC'::text, now()) NOT NULL
);
ALTER TABLE public.assertion OWNER TO postgres;
--
-- Name: function_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.function_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE public.function_id_seq OWNER TO postgres;
--
-- Name: function; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.function (
id integer DEFAULT nextval('public.function_id_seq'::regclass) NOT NULL,
text character varying(64) NOT NULL,
source character varying(64) NOT NULL,
popularity integer DEFAULT 0 NOT NULL
);
ALTER TABLE public.function OWNER TO postgres;
--
-- Name: functionCall; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."functionCall" (
input integer NOT NULL,
function integer NOT NULL
);
ALTER TABLE public."functionCall" OWNER TO postgres;
--
-- Name: hits; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.hits (
"timestamp" timestamp without time zone NOT NULL,
site character varying,
remote_addr inet,
remote_user character varying,
http_agent character varying,
ssl_cipher character varying,
ssl_protocol character varying,
req_method character varying,
req_path character varying,
req_http character varying,
status integer,
bytes_sent integer,
frontend character varying,
upstream character varying[],
upstream_response_time real[]
);
ALTER TABLE public.hits OWNER TO postgres;
--
-- Name: input; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.input (
short character varying(8) NOT NULL,
source integer,
id integer NOT NULL,
hash character varying(28) NOT NULL,
state character varying(12) DEFAULT 'new'::character varying NOT NULL,
"operationCount" smallint,
alias character varying(16),
"user" integer,
penalty smallint DEFAULT 0 NOT NULL,
title character varying(64),
created timestamp without time zone DEFAULT timezone('UTC'::text, now()),
"runArchived" boolean DEFAULT false NOT NULL,
"bughuntIgnore" boolean DEFAULT false NOT NULL,
"lastResultChange" timestamp without time zone
);
ALTER TABLE public.input OWNER TO postgres;
--
-- Name: input_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.input_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE public.input_id_seq OWNER TO postgres;
--
-- Name: input_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.input_id_seq OWNED BY public.input.id;
--
-- Name: input_src; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.input_src (
input integer NOT NULL,
raw bytea
);
ALTER TABLE public.input_src OWNER TO postgres;
--
-- Name: output; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.output (
hash character(28) NOT NULL,
raw bytea NOT NULL,
id integer NOT NULL
);
ALTER TABLE public.output OWNER TO postgres;
--
-- Name: output_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.output_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE public.output_id_seq OWNER TO postgres;
--
-- Name: output_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.output_id_seq OWNED BY public.output.id;
--
-- Name: queue; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.queue (
input character varying(28) NOT NULL,
version character varying(24),
"maxPackets" integer DEFAULT 0 NOT NULL,
"maxRuntime" integer DEFAULT 2500 NOT NULL,
"maxOutput" integer DEFAULT 32768 NOT NULL
);
ALTER TABLE public.queue OWNER TO postgres;
--
-- Name: references_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.references_id_seq
START WITH 1000
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE public.references_id_seq OWNER TO postgres;
--
-- Name: result; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.result (
input integer NOT NULL,
version smallint NOT NULL,
output integer NOT NULL,
"exitCode" smallint DEFAULT 0 NOT NULL,
"userTime" real NOT NULL,
"systemTime" real NOT NULL,
"maxMemory" integer NOT NULL,
runs smallint DEFAULT 1 NOT NULL,
mutations smallint DEFAULT 0 NOT NULL
)
PARTITION BY LIST (version);
ALTER TABLE public.result OWNER TO postgres;
--
-- Name: version; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.version (
name character varying(24) NOT NULL,
released date DEFAULT now(),
"order" integer,
command character varying(254) DEFAULT '/bin/php-XXX -c /etc -q'::character varying NOT NULL,
"isHelper" boolean DEFAULT false NOT NULL,
id smallint NOT NULL,
eol date
);
ALTER TABLE public.version OWNER TO postgres;
--
-- Name: version_forBughunt; Type: VIEW; Schema: public; Owner: postgres
--
CREATE VIEW public."version_forBughunt" AS
SELECT name,
released,
"order",
command,
"isHelper",
id,
eol
FROM public.version
WHERE ((now() - (released)::timestamp with time zone) < '2 mons'::interval);
ALTER VIEW public."version_forBughunt" OWNER TO postgres;
--
-- Name: result_bughunt; Type: MATERIALIZED VIEW; Schema: public; Owner: postgres
--
CREATE MATERIALIZED VIEW public.result_bughunt AS
WITH r AS (
SELECT result.input,
result.version,
result.output,
result."exitCode",
result."userTime",
result."systemTime",
result."maxMemory",
result.runs,
result.mutations
FROM public.result
WHERE (result.version IN ( SELECT "version_forBughunt".id
FROM public."version_forBughunt"))
)
SELECT input,
version,
output,
"exitCode",
"userTime",
"systemTime",
"maxMemory",
runs,
mutations
FROM r
WHERE (input IN ( SELECT input.id
FROM (r r1
JOIN public.input ON ((input.id = r1.input)))
WHERE (NOT input."bughuntIgnore")
GROUP BY input.id
HAVING (count(DISTINCT r1.output) > 1)))
WITH NO DATA;
ALTER TABLE ONLY public.result_bughunt ALTER COLUMN input SET STATISTICS 800;
ALTER TABLE ONLY public.result_bughunt ALTER COLUMN version SET STATISTICS 800;
ALTER MATERIALIZED VIEW public.result_bughunt OWNER TO postgres;
--
-- Name: result_helper; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.result_helper (
input integer NOT NULL,
version smallint NOT NULL,
output integer NOT NULL,
"exitCode" smallint DEFAULT 0 NOT NULL,
"userTime" real NOT NULL,
"systemTime" real NOT NULL,
"maxMemory" integer NOT NULL,
runs smallint DEFAULT 1 NOT NULL,
mutations smallint DEFAULT 0 NOT NULL
);
ALTER TABLE public.result_helper OWNER TO postgres;
--
-- Name: result_php4; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.result_php4 (
input integer NOT NULL,
version smallint NOT NULL,
output integer NOT NULL,
"exitCode" smallint DEFAULT 0 NOT NULL,
"userTime" real NOT NULL,
"systemTime" real NOT NULL,
"maxMemory" integer NOT NULL,
runs smallint DEFAULT 1 NOT NULL,
mutations smallint DEFAULT 0 NOT NULL
);
ALTER TABLE public.result_php4 OWNER TO postgres;
--
-- Name: result_php53; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.result_php53 (
input integer NOT NULL,
version smallint NOT NULL,
output integer NOT NULL,
"exitCode" smallint DEFAULT 0 NOT NULL,
"userTime" real NOT NULL,
"systemTime" real NOT NULL,
"maxMemory" integer NOT NULL,
runs smallint DEFAULT 1 NOT NULL,
mutations smallint DEFAULT 0 NOT NULL
);
ALTER TABLE public.result_php53 OWNER TO postgres;
--
-- Name: result_php54; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.result_php54 (
input integer NOT NULL,
version smallint NOT NULL,
output integer NOT NULL,
"exitCode" smallint DEFAULT 0 NOT NULL,
"userTime" real NOT NULL,
"systemTime" real NOT NULL,
"maxMemory" integer NOT NULL,
runs smallint DEFAULT 1 NOT NULL,
mutations smallint DEFAULT 0 NOT NULL
);
ALTER TABLE public.result_php54 OWNER TO postgres;
--
-- Name: result_php55; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.result_php55 (
input integer NOT NULL,
version smallint NOT NULL,
output integer NOT NULL,
"exitCode" smallint DEFAULT 0 NOT NULL,
"userTime" real NOT NULL,
"systemTime" real NOT NULL,
"maxMemory" integer NOT NULL,
runs smallint DEFAULT 1 NOT NULL,
mutations smallint DEFAULT 0 NOT NULL
);
ALTER TABLE public.result_php55 OWNER TO postgres;
--
-- Name: result_php56; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.result_php56 (
input integer NOT NULL,
version smallint NOT NULL,
output integer NOT NULL,
"exitCode" smallint DEFAULT 0 NOT NULL,
"userTime" real NOT NULL,
"systemTime" real NOT NULL,
"maxMemory" integer NOT NULL,
runs smallint DEFAULT 1 NOT NULL,
mutations smallint DEFAULT 0 NOT NULL
);
ALTER TABLE public.result_php56 OWNER TO postgres;
--
-- Name: result_php5x; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.result_php5x (
input integer NOT NULL,
version smallint NOT NULL,
output integer NOT NULL,
"exitCode" smallint DEFAULT 0 NOT NULL,
"userTime" real NOT NULL,
"systemTime" real NOT NULL,
"maxMemory" integer NOT NULL,
runs smallint DEFAULT 1 NOT NULL,
mutations smallint DEFAULT 0 NOT NULL
);
ALTER TABLE public.result_php5x OWNER TO postgres;
--
-- Name: result_php70; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.result_php70 (
input integer NOT NULL,
version smallint NOT NULL,
output integer NOT NULL,
"exitCode" smallint DEFAULT 0 NOT NULL,
"userTime" real NOT NULL,
"systemTime" real NOT NULL,
"maxMemory" integer NOT NULL,
runs smallint DEFAULT 1 NOT NULL,
mutations smallint DEFAULT 0 NOT NULL
);
ALTER TABLE public.result_php70 OWNER TO postgres;
--
-- Name: result_php71; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.result_php71 (
input integer NOT NULL,
version smallint NOT NULL,
output integer NOT NULL,
"exitCode" smallint DEFAULT 0 NOT NULL,
"userTime" real NOT NULL,
"systemTime" real NOT NULL,
"maxMemory" integer NOT NULL,
runs smallint DEFAULT 1 NOT NULL,
mutations smallint DEFAULT 0 NOT NULL
);
ALTER TABLE public.result_php71 OWNER TO postgres;
--
-- Name: result_php72; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.result_php72 (
input integer NOT NULL,
version smallint NOT NULL,
output integer NOT NULL,
"exitCode" smallint DEFAULT 0 NOT NULL,
"userTime" real NOT NULL,
"systemTime" real NOT NULL,
"maxMemory" integer NOT NULL,
runs smallint DEFAULT 1 NOT NULL,
mutations smallint DEFAULT 0 NOT NULL
);
ALTER TABLE public.result_php72 OWNER TO postgres;
--
-- Name: result_php73; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.result_php73 (
input integer NOT NULL,
version smallint NOT NULL,
output integer NOT NULL,
"exitCode" smallint DEFAULT 0 NOT NULL,
"userTime" real NOT NULL,
"systemTime" real NOT NULL,
"maxMemory" integer NOT NULL,
runs smallint DEFAULT 1 NOT NULL,
mutations smallint DEFAULT 0 NOT NULL
);
ALTER TABLE public.result_php73 OWNER TO postgres;
--
-- Name: result_php74; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.result_php74 (
input integer NOT NULL,
version smallint NOT NULL,
output integer NOT NULL,
"exitCode" smallint DEFAULT 0 NOT NULL,
"userTime" real NOT NULL,
"systemTime" real NOT NULL,
"maxMemory" integer NOT NULL,
runs smallint DEFAULT 1 NOT NULL,
mutations smallint DEFAULT 0 NOT NULL
);
ALTER TABLE public.result_php74 OWNER TO postgres;
--
-- Name: result_php80; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.result_php80 (
input integer NOT NULL,
version smallint NOT NULL,
output integer NOT NULL,
"exitCode" smallint DEFAULT NULL NOT NULL,
"userTime" real NOT NULL,
"systemTime" real NOT NULL,
"maxMemory" integer NOT NULL,
runs smallint DEFAULT NULL NOT NULL,
mutations smallint DEFAULT NULL NOT NULL
);
ALTER TABLE public.result_php80 OWNER TO postgres;
--
-- Name: result_php81; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.result_php81 (
input integer NOT NULL,
version smallint NOT NULL,
output integer NOT NULL,
"exitCode" smallint DEFAULT 0 NOT NULL,
"userTime" real NOT NULL,
"systemTime" real NOT NULL,
"maxMemory" integer NOT NULL,
runs smallint DEFAULT 1 NOT NULL,
mutations smallint DEFAULT 0 NOT NULL
);
ALTER TABLE public.result_php81 OWNER TO postgres;
--
-- Name: result_php82; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.result_php82 (
input integer NOT NULL,
version smallint NOT NULL,
output integer NOT NULL,
"exitCode" smallint DEFAULT 0 NOT NULL,
"userTime" real NOT NULL,
"systemTime" real NOT NULL,
"maxMemory" integer NOT NULL,
runs smallint DEFAULT 1 NOT NULL,
mutations smallint DEFAULT 0 NOT NULL
);
ALTER TABLE public.result_php82 OWNER TO postgres;
--
-- Name: result_php83; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.result_php83 (
input integer NOT NULL,
version smallint NOT NULL,
output integer NOT NULL,
"exitCode" smallint DEFAULT 0 NOT NULL,
"userTime" real NOT NULL,
"systemTime" real NOT NULL,
"maxMemory" integer NOT NULL,
runs smallint DEFAULT 1 NOT NULL,
mutations smallint DEFAULT 0 NOT NULL
);
ALTER TABLE public.result_php83 OWNER TO postgres;
--
-- Name: result_rfc; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.result_rfc (
input integer NOT NULL,
version smallint NOT NULL,
output integer NOT NULL,
"exitCode" smallint DEFAULT 0 NOT NULL,
"userTime" real NOT NULL,
"systemTime" real NOT NULL,
"maxMemory" integer NOT NULL,
runs smallint DEFAULT 1 NOT NULL,
mutations smallint DEFAULT 0 NOT NULL
);
ALTER TABLE public.result_rfc OWNER TO postgres;
--
-- Name: submit; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.submit (
input integer NOT NULL,
ip inet NOT NULL,
created timestamp without time zone DEFAULT timezone('UTC'::text, now()),
updated timestamp without time zone,
count integer DEFAULT 1 NOT NULL,
"isQuick" boolean DEFAULT false
);
ALTER TABLE public.submit OWNER TO postgres;
--
-- Name: tx_in; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.tx_in (
transaction character varying(64) NOT NULL,
"user" integer,
amount integer
);
ALTER TABLE public.tx_in OWNER TO postgres;
--
-- Name: COLUMN tx_in.amount; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.tx_in.amount IS 'satoshis received by us';
--
-- Name: tx_out; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.tx_out (
"user" integer NOT NULL,
product integer NOT NULL,
amount real NOT NULL,
script integer,
created timestamp without time zone DEFAULT timezone('UTC'::text, now()) NOT NULL,
product_price integer
);
ALTER TABLE public.tx_out OWNER TO postgres;
--
-- Name: COLUMN tx_out.amount; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.tx_out.amount IS 'number of products bought';
--
-- Name: COLUMN tx_out.product_price; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.tx_out.product_price IS 'product.price at time of spending';
--
-- Name: tx_product_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.tx_product_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE public.tx_product_id_seq OWNER TO postgres;
--
-- Name: tx_product; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.tx_product (
id integer DEFAULT nextval('public.tx_product_id_seq'::regclass) NOT NULL,
per_script boolean NOT NULL,
price integer NOT NULL,
description character varying(128) NOT NULL,
key character varying(32)
);
ALTER TABLE public.tx_product OWNER TO postgres;
--
-- Name: user; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."user" (
name character varying(15) NOT NULL,
created timestamp without time zone DEFAULT timezone('UTC'::text, now()),
last_login timestamp without time zone,
login_count integer DEFAULT 0 NOT NULL,
id integer NOT NULL,
"btcAddress" character varying(35)
);
ALTER TABLE public."user" OWNER TO postgres;
--
-- Name: user_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.user_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE public.user_id_seq OWNER TO postgres;
--
-- Name: user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.user_id_seq OWNED BY public."user".id;
--
-- Name: version_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.version_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE public.version_id_seq OWNER TO postgres;
--
-- Name: version_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.version_id_seq OWNED BY public.version.id;
--
-- Name: result_helper; Type: TABLE ATTACH; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.result ATTACH PARTITION public.result_helper FOR VALUES IN ('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16');
--
-- Name: result_php4; Type: TABLE ATTACH; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.result ATTACH PARTITION public.result_php4 FOR VALUES IN ('32', '33', '34', '35', '36', '37', '38', '39', '40', '43', '45', '47', '49', '51', '54', '58', '60', '64', '65', '66', '71', '73');
--
-- Name: result_php53; Type: TABLE ATTACH; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.result ATTACH PARTITION public.result_php53 FOR VALUES IN ('78', '80', '83', '85', '87', '90', '91', '92', '93', '94', '95', '98', '100', '101', '104', '106', '107', '110', '112', '113', '116', '118', '119', '121', '123', '126', '128', '131', '143', '162');
--
-- Name: result_php54; Type: TABLE ATTACH; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.result ATTACH PARTITION public.result_php54 FOR VALUES IN ('96', '97', '99', '102', '103', '105', '108', '109', '111', '114', '115', '117', '120', '122', '124', '125', '127', '130', '133', '135', '138', '140', '141', '145', '146', '149', '151', '153', '155', '157', '158', '161', '163', '168', '172', '175', '177', '181', '183', '186', '190', '194', '197', '205', '212', '372');
--
-- Name: result_php55; Type: TABLE ATTACH; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.result ATTACH PARTITION public.result_php55 FOR VALUES IN ('129', '132', '134', '136', '137', '139', '142', '144', '147', '148', '150', '152', '154', '156', '159', '160', '164', '169', '170', '174', '178', '179', '182', '187', '189', '192', '200', '204', '209', '214', '231', '234', '238', '241', '245', '248', '254', '258', '371');
--
-- Name: result_php56; Type: TABLE ATTACH; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.result ATTACH PARTITION public.result_php56 FOR VALUES IN ('165', '166', '167', '171', '173', '176', '180', '184', '188', '191', '193', '198', '203', '210', '216', '221', '225', '230', '233', '239', '242', '244', '247', '253', '259', '263', '268', '272', '276', '282', '285', '380', '381', '382', '383', '384', '385', '386', '387', '410', '411');
--
-- Name: result_php5x; Type: TABLE ATTACH; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.result ATTACH PARTITION public.result_php5x FOR VALUES IN ('41', '42', '44', '46', '48', '50', '52', '53', '55', '56', '57', '59', '61', '62', '63', '67', '68', '69', '70', '72', '74', '75', '76', '77', '79', '81', '82', '84', '86', '88', '89');
--
-- Name: result_php70; Type: TABLE ATTACH; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.result ATTACH PARTITION public.result_php70 FOR VALUES IN ('226', '228', '229', '232', '237', '240', '243', '246', '251', '256', '262', '267', '271', '275', '281', '286', '297', '302', '304', '306', '309', '325', '326', '327', '330', '337', '341', '344', '352', '354', '361', '370', '396', '400');
--
-- Name: result_php71; Type: TABLE ATTACH; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.result ATTACH PARTITION public.result_php71 FOR VALUES IN ('280', '283', '295', '301', '303', '307', '308', '313', '316', '323', '329', '336', '340', '345', '346', '349', '351', '355', '362', '363', '369', '374', '378', '391', '398', '401', '412', '413', '416', '421', '422', '431', '436', '445');
--
-- Name: result_php72; Type: TABLE ATTACH; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.result ATTACH PARTITION public.result_php72 FOR VALUES IN ('342', '343', '347', '348', '350', '353', '356', '360', '364', '373', '377', '392', '395', '402', '406', '407', '409', '415', '418', '420', '426', '430', '435', '440', '444', '449', '453', '456', '459', '462', '467', '468', '474', '477', '488');
--
-- Name: result_php73; Type: TABLE ATTACH; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.result ATTACH PARTITION public.result_php73 FOR VALUES IN ('403', '404', '405', '408', '414', '417', '419', '425', '429', '434', '439', '443', '448', '452', '455', '458', '461', '464', '466', '470', '473', '479', '482', '485', '493', '498', '501', '504', '509', '516', '521', '526', '532', '533');
--
-- Name: result_php74; Type: TABLE ATTACH; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.result ATTACH PARTITION public.result_php74 FOR VALUES IN ('450', '451', '454', '457', '460', '463', '465', '469', '472', '478', '483', '486', '494', '499', '502', '505', '507', '512', '514', '515', '517', '519', '522', '527', '530', '534', '537', '542', '547', '552', '567', '570');
--
-- Name: result_php80; Type: TABLE ATTACH; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.result ATTACH PARTITION public.result_php80 FOR VALUES IN ('500', '503', '506', '508', '510', '511', '513', '518', '520', '523', '528', '531', '535', '539', '540', '543', '545', '549', '551', '554', '556', '558', '560', '563', '569', '572', '580', '586', '595', '600');
--
-- Name: result_php81; Type: TABLE ATTACH; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.result ATTACH PARTITION public.result_php81 FOR VALUES IN ('536', '538', '541', '544', '546', '548', '550', '553', '555', '557', '559', '562', '568', '571', '581', '583', '585', '588', '590', '592', '594', '597', '599', '602', '603', '605', '608', '610');
--
-- Name: result_php82; Type: TABLE ATTACH; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.result ATTACH PARTITION public.result_php82 FOR VALUES IN ('578', '579', '582', '584', '587', '589', '591', '593', '596', '598', '601', '604', '606', '607', '612', '614', '616');
--
-- Name: result_php83; Type: TABLE ATTACH; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.result ATTACH PARTITION public.result_php83 FOR VALUES IN ('609', '611', '613', '615');
--
-- Name: result_rfc; Type: TABLE ATTACH; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.result ATTACH PARTITION public.result_rfc FOR VALUES IN ('17', '18');
--
-- Name: input id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.input ALTER COLUMN id SET DEFAULT nextval('public.input_id_seq'::regclass);
--
-- Name: output id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.output ALTER COLUMN id SET DEFAULT nextval('public.output_id_seq'::regclass);
--
-- Name: user id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."user" ALTER COLUMN id SET DEFAULT nextval('public.user_id_seq'::regclass);
--
-- Name: version id; Type: DEFAULT; Schema: public; Owner: postgres