-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathaiq_data_v0_6.portable_generator.schema.2022.08.16.sql
More file actions
1685 lines (1106 loc) · 45.3 KB
/
aiq_data_v0_6.portable_generator.schema.2022.08.16.sql
File metadata and controls
1685 lines (1106 loc) · 45.3 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 12.5
-- Dumped by pg_dump version 12.6
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: dataset_types; Type: TYPE; Schema: public; Owner: aiq_user
--
CREATE TYPE public.dataset_types AS ENUM (
'train',
'test',
'live_train',
'live_test'
);
ALTER TYPE public.dataset_types OWNER TO aiq_user;
--
-- Name: difficulty_type; Type: TYPE; Schema: public; Owner: aiq_user
--
CREATE TYPE public.difficulty_type AS ENUM (
'easy',
'medium',
'hard'
);
ALTER TYPE public.difficulty_type OWNER TO aiq_user;
--
-- Name: experiment_types; Type: TYPE; Schema: public; Owner: aiq_user
--
CREATE TYPE public.experiment_types AS ENUM (
'AIQ',
'SAIL-ON',
'SAIL-ON-SOTA'
);
ALTER TYPE public.experiment_types OWNER TO aiq_user;
--
-- Name: access_control_access_control_id_seq; Type: SEQUENCE; Schema: public; Owner: aiq_user
--
CREATE SEQUENCE public.access_control_access_control_id_seq
START WITH 1
INCREMENT BY 1
MINVALUE 0
NO MAXVALUE
CACHE 1;
ALTER TABLE public.access_control_access_control_id_seq OWNER TO aiq_user;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: access_control; Type: TABLE; Schema: public; Owner: aiq_user
--
CREATE TABLE public.access_control (
access_control_id integer DEFAULT nextval('public.access_control_access_control_id_seq'::regclass) NOT NULL,
access_level text NOT NULL,
access_group text NOT NULL,
user_id integer NOT NULL,
created_on timestamp without time zone DEFAULT now() NOT NULL,
updated_at timestamp without time zone
);
ALTER TABLE public.access_control OWNER TO aiq_user;
--
-- Name: access_group; Type: TABLE; Schema: public; Owner: aiq_user
--
CREATE TABLE public.access_group (
name text NOT NULL,
description text,
created_on timestamp without time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.access_group OWNER TO aiq_user;
--
-- Name: access_level; Type: TABLE; Schema: public; Owner: aiq_user
--
CREATE TABLE public.access_level (
name text NOT NULL,
description text,
created_on timestamp without time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.access_level OWNER TO aiq_user;
--
-- Name: data; Type: TABLE; Schema: public; Owner: aiq_user
--
CREATE TABLE public.data (
data_id bigint NOT NULL,
feature_vector jsonb NOT NULL,
label jsonb NOT NULL,
data_index bigint NOT NULL,
episode_id bigint NOT NULL
);
ALTER TABLE public.data OWNER TO aiq_user;
--
-- Name: data_data_id_seq; Type: SEQUENCE; Schema: public; Owner: aiq_user
--
CREATE SEQUENCE public.data_data_id_seq
START WITH 1
INCREMENT BY 1
MINVALUE 0
NO MAXVALUE
CACHE 1;
ALTER TABLE public.data_data_id_seq OWNER TO aiq_user;
--
-- Name: data_data_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: aiq_user
--
ALTER SEQUENCE public.data_data_id_seq OWNED BY public.data.data_id;
--
-- Name: dataset; Type: TABLE; Schema: public; Owner: aiq_user
--
CREATE TABLE public.dataset (
dataset_id bigint NOT NULL,
name text NOT NULL,
version text NOT NULL,
utc_created_on timestamp without time zone DEFAULT now() NOT NULL,
description text,
novelty smallint NOT NULL,
seed numeric NOT NULL,
domain_id integer NOT NULL,
data_type public.dataset_types NOT NULL,
episodes bigint,
difficulty public.difficulty_type DEFAULT 'medium'::public.difficulty_type NOT NULL,
locked_by uuid,
locked_at timestamp without time zone DEFAULT now() NOT NULL,
trial_novelty smallint
);
ALTER TABLE public.dataset OWNER TO aiq_user;
--
-- Name: dataset_dataset_id_seq; Type: SEQUENCE; Schema: public; Owner: aiq_user
--
CREATE SEQUENCE public.dataset_dataset_id_seq
START WITH 1
INCREMENT BY 1
MINVALUE 0
NO MAXVALUE
CACHE 1;
ALTER TABLE public.dataset_dataset_id_seq OWNER TO aiq_user;
--
-- Name: dataset_dataset_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: aiq_user
--
ALTER SEQUENCE public.dataset_dataset_id_seq OWNED BY public.dataset.dataset_id;
--
-- Name: domain_domain_id_seq; Type: SEQUENCE; Schema: public; Owner: aiq_user
--
CREATE SEQUENCE public.domain_domain_id_seq
START WITH 1
INCREMENT BY 1
MINVALUE 0
NO MAXVALUE
CACHE 1;
ALTER TABLE public.domain_domain_id_seq OWNER TO aiq_user;
--
-- Name: domain; Type: TABLE; Schema: public; Owner: aiq_user
--
CREATE TABLE public.domain (
domain_id integer DEFAULT nextval('public.domain_domain_id_seq'::regclass) NOT NULL,
name text NOT NULL,
description text,
utc_created_on timestamp without time zone DEFAULT now() NOT NULL,
utc_updated_on timestamp without time zone
);
ALTER TABLE public.domain OWNER TO aiq_user;
--
-- Name: episode_episode_id_seq; Type: SEQUENCE; Schema: public; Owner: aiq_user
--
CREATE SEQUENCE public.episode_episode_id_seq
START WITH 1
INCREMENT BY 1
MINVALUE 0
NO MAXVALUE
CACHE 1;
ALTER TABLE public.episode_episode_id_seq OWNER TO aiq_user;
--
-- Name: episode; Type: TABLE; Schema: public; Owner: aiq_user
--
CREATE TABLE public.episode (
episode_id bigint DEFAULT nextval('public.episode_episode_id_seq'::regclass) NOT NULL,
dataset_id bigint NOT NULL,
size integer,
episode_index bigint,
seed numeric
);
ALTER TABLE public.episode OWNER TO aiq_user;
--
-- Name: experiment_domain; Type: TABLE; Schema: public; Owner: aiq_user
--
CREATE TABLE public.experiment_domain (
model_experiment_id bigint NOT NULL,
domain_id integer NOT NULL
);
ALTER TABLE public.experiment_domain OWNER TO aiq_user;
--
-- Name: experiment_log; Type: TABLE; Schema: public; Owner: aiq_user
--
CREATE TABLE public.experiment_log (
experiment_log_id bigint NOT NULL,
model_experiment_id bigint NOT NULL,
utc_stamp timestamp without time zone DEFAULT now() NOT NULL,
action text NOT NULL,
message text,
object jsonb,
experiment_trial_id bigint
);
ALTER TABLE public.experiment_log OWNER TO aiq_user;
--
-- Name: experiment_log_experiment_log_id_seq; Type: SEQUENCE; Schema: public; Owner: aiq_user
--
CREATE SEQUENCE public.experiment_log_experiment_log_id_seq
START WITH 1
INCREMENT BY 1
MINVALUE 0
NO MAXVALUE
CACHE 1;
ALTER TABLE public.experiment_log_experiment_log_id_seq OWNER TO aiq_user;
--
-- Name: experiment_log_experiment_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: aiq_user
--
ALTER SEQUENCE public.experiment_log_experiment_log_id_seq OWNED BY public.experiment_log.experiment_log_id;
--
-- Name: experiment_trial_experiment_trial_id_seq; Type: SEQUENCE; Schema: public; Owner: aiq_user
--
CREATE SEQUENCE public.experiment_trial_experiment_trial_id_seq
START WITH 1
INCREMENT BY 1
MINVALUE 0
NO MAXVALUE
CACHE 1;
ALTER TABLE public.experiment_trial_experiment_trial_id_seq OWNER TO aiq_user;
--
-- Name: experiment_trial; Type: TABLE; Schema: public; Owner: aiq_user
--
CREATE TABLE public.experiment_trial (
experiment_trial_id bigint DEFAULT nextval('public.experiment_trial_experiment_trial_id_seq'::regclass) NOT NULL,
model_experiment_id bigint NOT NULL,
trial integer DEFAULT 0 NOT NULL,
is_active boolean DEFAULT false NOT NULL,
novelty integer DEFAULT 0 NOT NULL,
novelty_visibility integer DEFAULT 0 NOT NULL,
difficulty public.difficulty_type DEFAULT 'medium'::public.difficulty_type NOT NULL,
novelty_description jsonb NOT NULL,
utc_stamp_started timestamp without time zone,
utc_stamp_ended timestamp without time zone,
locked_by uuid,
is_complete boolean DEFAULT false NOT NULL,
utc_last_updated timestamp without time zone,
hint_level smallint DEFAULT -1 NOT NULL,
filename text,
is_data_imported boolean DEFAULT false NOT NULL
);
ALTER TABLE public.experiment_trial OWNER TO aiq_user;
--
-- Name: model; Type: TABLE; Schema: public; Owner: aiq_user
--
CREATE TABLE public.model (
model_id integer NOT NULL,
user_id integer NOT NULL,
name text NOT NULL,
description text,
organization_id integer NOT NULL,
share_with_organization boolean DEFAULT false NOT NULL
);
ALTER TABLE public.model OWNER TO aiq_user;
--
-- Name: model_experiment_model_experiment_id_seq; Type: SEQUENCE; Schema: public; Owner: aiq_user
--
CREATE SEQUENCE public.model_experiment_model_experiment_id_seq
START WITH 1
INCREMENT BY 1
MINVALUE 0
NO MAXVALUE
CACHE 1;
ALTER TABLE public.model_experiment_model_experiment_id_seq OWNER TO aiq_user;
--
-- Name: model_experiment; Type: TABLE; Schema: public; Owner: aiq_user
--
CREATE TABLE public.model_experiment (
model_experiment_id bigint DEFAULT nextval('public.model_experiment_model_experiment_id_seq'::regclass) NOT NULL,
model_id integer NOT NULL,
novelty smallint NOT NULL,
seed numeric NOT NULL,
git_version text NOT NULL,
utc_stamp_started timestamp without time zone DEFAULT now() NOT NULL,
utc_stamp_ended timestamp without time zone,
description text,
secret uuid NOT NULL,
novelty_visibility integer DEFAULT 0 NOT NULL,
experiment_type public.experiment_types DEFAULT 'AIQ'::public.experiment_types NOT NULL,
sota_experiment_id bigint,
is_active boolean DEFAULT true NOT NULL,
experiment_json json,
vhost text NOT NULL,
phase text DEFAULT '3' NOT NULL
);
ALTER TABLE public.model_experiment OWNER TO aiq_user;
--
-- Name: model_model_id_seq; Type: SEQUENCE; Schema: public; Owner: aiq_user
--
CREATE SEQUENCE public.model_model_id_seq
START WITH 1
INCREMENT BY 1
MINVALUE 0
NO MAXVALUE
CACHE 1;
ALTER TABLE public.model_model_id_seq OWNER TO aiq_user;
--
-- Name: model_model_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: aiq_user
--
ALTER SEQUENCE public.model_model_id_seq OWNED BY public.model.model_id;
--
-- Name: organization_organization_id_seq; Type: SEQUENCE; Schema: public; Owner: aiq_user
--
CREATE SEQUENCE public.organization_organization_id_seq
START WITH 1
INCREMENT BY 1
MINVALUE 0
NO MAXVALUE
CACHE 1;
ALTER TABLE public.organization_organization_id_seq OWNER TO aiq_user;
--
-- Name: organization; Type: TABLE; Schema: public; Owner: aiq_user
--
CREATE TABLE public.organization (
organization_id integer DEFAULT nextval('public.organization_organization_id_seq'::regclass) NOT NULL,
name text NOT NULL,
utc_created_on timestamp without time zone DEFAULT now() NOT NULL,
share_model_by_default boolean DEFAULT false NOT NULL
);
ALTER TABLE public.organization OWNER TO aiq_user;
--
-- Name: organization_users; Type: TABLE; Schema: public; Owner: aiq_user
--
CREATE TABLE public.organization_users (
organization_id integer NOT NULL,
user_id integer NOT NULL,
organization_owner boolean DEFAULT false NOT NULL,
utc_created_on timestamp without time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.organization_users OWNER TO aiq_user;
--
-- Name: sota_experiments_sota_experiments_id_seq; Type: SEQUENCE; Schema: public; Owner: aiq_user
--
CREATE SEQUENCE public.sota_experiments_sota_experiments_id_seq
START WITH 1
INCREMENT BY 1
MINVALUE 0
NO MAXVALUE
CACHE 1;
ALTER TABLE public.sota_experiments_sota_experiments_id_seq OWNER TO aiq_user;
--
-- Name: sota_experiments; Type: TABLE; Schema: public; Owner: aiq_user
--
CREATE TABLE public.sota_experiments (
sota_experiments_id bigint DEFAULT nextval('public.sota_experiments_sota_experiments_id_seq'::regclass) NOT NULL,
experiment_json jsonb NOT NULL,
utc_created_on timestamp without time zone DEFAULT now() NOT NULL,
domain_id integer NOT NULL,
version text NOT NULL,
claimed_id uuid,
model_experiment_id bigint NOT NULL,
vhost text NOT NULL
);
ALTER TABLE public.sota_experiments OWNER TO aiq_user;
--
-- Name: test_instance; Type: TABLE; Schema: public; Owner: aiq_user
--
CREATE TABLE public.test_instance (
test_instance_id bigint NOT NULL,
data_id bigint NOT NULL,
utc_stamp_sent timestamp without time zone DEFAULT now() NOT NULL,
utc_stamp_received timestamp without time zone,
utc_remote_stamp_arrived timestamp without time zone,
utc_remote_stamp_replied timestamp without time zone,
trial_episode_id bigint NOT NULL
);
ALTER TABLE public.test_instance OWNER TO aiq_user;
--
-- Name: test_instance_test_instance_id_seq; Type: SEQUENCE; Schema: public; Owner: aiq_user
--
CREATE SEQUENCE public.test_instance_test_instance_id_seq
START WITH 1
INCREMENT BY 1
MINVALUE 0
NO MAXVALUE
CACHE 1;
ALTER TABLE public.test_instance_test_instance_id_seq OWNER TO aiq_user;
--
-- Name: test_instance_test_instance_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: aiq_user
--
ALTER SEQUENCE public.test_instance_test_instance_id_seq OWNED BY public.test_instance.test_instance_id;
--
-- Name: test_label; Type: TABLE; Schema: public; Owner: aiq_user
--
CREATE TABLE public.test_label (
test_label_id bigint NOT NULL,
label_prediction jsonb NOT NULL,
test_instance_id bigint NOT NULL,
performance numeric,
feedback jsonb
);
ALTER TABLE public.test_label OWNER TO aiq_user;
--
-- Name: test_label_test_label_id_seq; Type: SEQUENCE; Schema: public; Owner: aiq_user
--
CREATE SEQUENCE public.test_label_test_label_id_seq
START WITH 1
INCREMENT BY 1
MINVALUE 0
NO MAXVALUE
CACHE 1;
ALTER TABLE public.test_label_test_label_id_seq OWNER TO aiq_user;
--
-- Name: test_label_test_label_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: aiq_user
--
ALTER SEQUENCE public.test_label_test_label_id_seq OWNED BY public.test_label.test_label_id;
--
-- Name: trial_episode_trial_episode_id_seq; Type: SEQUENCE; Schema: public; Owner: aiq_user
--
CREATE SEQUENCE public.trial_episode_trial_episode_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.trial_episode_trial_episode_id_seq OWNER TO aiq_user;
--
-- Name: trial_episode; Type: TABLE; Schema: public; Owner: aiq_user
--
CREATE TABLE public.trial_episode (
trial_episode_id bigint DEFAULT nextval('public.trial_episode_trial_episode_id_seq'::regclass) NOT NULL,
experiment_trial_id bigint NOT NULL,
episode_index integer NOT NULL,
novelty smallint,
novelty_initiated boolean,
performance numeric,
novelty_probability numeric,
novelty_characterization jsonb,
utc_stamp_started timestamp without time zone,
utc_stamp_ended timestamp without time zone,
novelty_threshold numeric,
budget_active boolean DEFAULT false NOT NULL,
hint_json jsonb,
hint_level smallint DEFAULT -1 NOT NULL
);
ALTER TABLE public.trial_episode OWNER TO aiq_user;
--
-- Name: users; Type: TABLE; Schema: public; Owner: aiq_user
--
CREATE TABLE public.users (
user_id integer NOT NULL,
username text NOT NULL,
password text NOT NULL,
secret uuid NOT NULL,
confirmed_at timestamp without time zone,
is_active boolean DEFAULT false NOT NULL,
first_name text DEFAULT 'FirstName'::text NOT NULL,
last_name text DEFAULT 'LastName'::text NOT NULL,
login_count integer DEFAULT 0 NOT NULL,
last_login_ip text,
last_seen timestamp without time zone
);
ALTER TABLE public.users OWNER TO aiq_user;
--
-- Name: user_available_models; Type: VIEW; Schema: public; Owner: aiq_user
--
CREATE VIEW public.user_available_models AS
SELECT users.user_id,
users.username,
organization.organization_id,
organization.name AS organization_name,
model.model_id,
model.name AS model_name,
model.share_with_organization
FROM (((public.users
JOIN public.organization_users ON ((users.user_id = organization_users.user_id)))
JOIN public.organization ON ((organization_users.organization_id = organization.organization_id)))
JOIN public.model ON ((organization.organization_id = model.organization_id)))
ORDER BY users.user_id, organization.organization_id, model.model_id;
ALTER TABLE public.user_available_models OWNER TO aiq_user;
--
-- Name: users_user_id_seq; Type: SEQUENCE; Schema: public; Owner: aiq_user
--
CREATE SEQUENCE public.users_user_id_seq
START WITH 1
INCREMENT BY 1
MINVALUE 0
NO MAXVALUE
CACHE 1;
ALTER TABLE public.users_user_id_seq OWNER TO aiq_user;
--
-- Name: users_user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: aiq_user
--
ALTER SEQUENCE public.users_user_id_seq OWNED BY public.users.user_id;
--
-- Name: website_log; Type: TABLE; Schema: public; Owner: aiq_user
--
CREATE TABLE public.website_log (
website_log_id integer NOT NULL,
stamp timestamp without time zone DEFAULT now() NOT NULL,
level integer DEFAULT 1 NOT NULL,
message text NOT NULL,
user_id integer
);
ALTER TABLE public.website_log OWNER TO aiq_user;
--
-- Name: website_log_website_log_id_seq; Type: SEQUENCE; Schema: public; Owner: aiq_user
--
CREATE SEQUENCE public.website_log_website_log_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.website_log_website_log_id_seq OWNER TO aiq_user;
--
-- Name: website_log_website_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: aiq_user
--
ALTER SEQUENCE public.website_log_website_log_id_seq OWNED BY public.website_log.website_log_id;
--
-- Name: data data_id; Type: DEFAULT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.data ALTER COLUMN data_id SET DEFAULT nextval('public.data_data_id_seq'::regclass);
--
-- Name: dataset dataset_id; Type: DEFAULT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.dataset ALTER COLUMN dataset_id SET DEFAULT nextval('public.dataset_dataset_id_seq'::regclass);
--
-- Name: experiment_log experiment_log_id; Type: DEFAULT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.experiment_log ALTER COLUMN experiment_log_id SET DEFAULT nextval('public.experiment_log_experiment_log_id_seq'::regclass);
--
-- Name: model model_id; Type: DEFAULT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.model ALTER COLUMN model_id SET DEFAULT nextval('public.model_model_id_seq'::regclass);
--
-- Name: test_instance test_instance_id; Type: DEFAULT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.test_instance ALTER COLUMN test_instance_id SET DEFAULT nextval('public.test_instance_test_instance_id_seq'::regclass);
--
-- Name: test_label test_label_id; Type: DEFAULT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.test_label ALTER COLUMN test_label_id SET DEFAULT nextval('public.test_label_test_label_id_seq'::regclass);
--
-- Name: users user_id; Type: DEFAULT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.users ALTER COLUMN user_id SET DEFAULT nextval('public.users_user_id_seq'::regclass);
--
-- Name: website_log website_log_id; Type: DEFAULT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.website_log ALTER COLUMN website_log_id SET DEFAULT nextval('public.website_log_website_log_id_seq'::regclass);
--
-- Name: access_control access_control_pkey; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.access_control
ADD CONSTRAINT access_control_pkey PRIMARY KEY (access_control_id);
--
-- Name: access_group access_group_pkey; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.access_group
ADD CONSTRAINT access_group_pkey PRIMARY KEY (name);
--
-- Name: access_level access_level_pkey; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.access_level
ADD CONSTRAINT access_level_pkey PRIMARY KEY (name);
--
-- Name: data data_episode_id_data_index_key; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.data
ADD CONSTRAINT data_episode_id_data_index_key UNIQUE (episode_id, data_index);
--
-- Name: data data_pkey; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.data
ADD CONSTRAINT data_pkey PRIMARY KEY (data_id);
--
-- Name: dataset dataset_domain_novelty_type_difficulty_version_trialnovelty_key; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.dataset
ADD CONSTRAINT dataset_domain_novelty_type_difficulty_version_trialnovelty_key UNIQUE (version, novelty, domain_id, data_type, difficulty, trial_novelty);
--
-- Name: dataset dataset_pkey; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.dataset
ADD CONSTRAINT dataset_pkey PRIMARY KEY (dataset_id);
--
-- Name: domain domain_name_key; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.domain
ADD CONSTRAINT domain_name_key UNIQUE (name);
--
-- Name: domain domain_pkey; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.domain
ADD CONSTRAINT domain_pkey PRIMARY KEY (domain_id);
--
-- Name: episode episode_dataset_id_episode_index_key; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.episode
ADD CONSTRAINT episode_dataset_id_episode_index_key UNIQUE (dataset_id, episode_index);
--
-- Name: episode episode_pkey; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.episode
ADD CONSTRAINT episode_pkey PRIMARY KEY (episode_id);
--
-- Name: experiment_domain experiment_domain_pkey; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.experiment_domain
ADD CONSTRAINT experiment_domain_pkey PRIMARY KEY (model_experiment_id, domain_id);
--
-- Name: experiment_log experiment_log_pkey; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.experiment_log
ADD CONSTRAINT experiment_log_pkey PRIMARY KEY (experiment_log_id);
--
-- Name: experiment_trial experiment_trial_mod_ex_id_trial_nov_nov_vis_diff_hint; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.experiment_trial
ADD CONSTRAINT experiment_trial_mod_ex_id_trial_nov_nov_vis_diff_hint UNIQUE (model_experiment_id, trial, novelty, novelty_visibility, difficulty, hint_level);
--
-- Name: experiment_trial experiment_trial_pkey; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.experiment_trial
ADD CONSTRAINT experiment_trial_pkey PRIMARY KEY (experiment_trial_id);
--
-- Name: model_experiment model_experiment_pkey; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.model_experiment
ADD CONSTRAINT model_experiment_pkey PRIMARY KEY (model_experiment_id);
--
-- Name: model model_pkey; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.model
ADD CONSTRAINT model_pkey PRIMARY KEY (model_id);
--
-- Name: model model_user_id_name_unique_key; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.model
ADD CONSTRAINT model_user_id_name_unique_key UNIQUE (user_id, name);
--
-- Name: organization organization_name_key; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.organization
ADD CONSTRAINT organization_name_key UNIQUE (name);
--
-- Name: organization organization_pkey; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.organization
ADD CONSTRAINT organization_pkey PRIMARY KEY (organization_id);
--
-- Name: organization_users organization_users_pkey; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.organization_users
ADD CONSTRAINT organization_users_pkey PRIMARY KEY (organization_id, user_id);
--
-- Name: sota_experiments sota_experiments_pkey; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.sota_experiments
ADD CONSTRAINT sota_experiments_pkey PRIMARY KEY (sota_experiments_id);
--
-- Name: test_instance test_instance_pkey; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.test_instance
ADD CONSTRAINT test_instance_pkey PRIMARY KEY (test_instance_id);
--
-- Name: test_label test_label_pkey; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.test_label
ADD CONSTRAINT test_label_pkey PRIMARY KEY (test_label_id);
--
-- Name: trial_episode trial_episode_pkey; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.trial_episode
ADD CONSTRAINT trial_episode_pkey PRIMARY KEY (trial_episode_id);
--
-- Name: trial_episode trial_episode_trial_episode_id_episode_index_key; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.trial_episode
ADD CONSTRAINT trial_episode_trial_episode_id_episode_index_key UNIQUE (experiment_trial_id, episode_index);
--
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.users
ADD CONSTRAINT users_pkey PRIMARY KEY (user_id);
--
-- Name: users users_secret_unique_key; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.users
ADD CONSTRAINT users_secret_unique_key UNIQUE (secret);
--
-- Name: users users_username_unique_key; Type: CONSTRAINT; Schema: public; Owner: aiq_user
--
ALTER TABLE ONLY public.users
ADD CONSTRAINT users_username_unique_key UNIQUE (username);
--
-- Name: website_log website_log_pkey; Type: CONSTRAINT; Schema: public; Owner: aiq_user