-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathschema.sql
1371 lines (939 loc) · 32.9 KB
/
schema.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
--
-- PostgreSQL database dump
--
-- Dumped from database version 13.4
-- Dumped by pg_dump version 13.4
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: pg_trgm; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public;
--
-- Name: EXTENSION pg_trgm; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION pg_trgm IS 'text similarity measurement and index searching based on trigrams';
--
-- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA public;
--
-- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)';
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: api_keys; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.api_keys (
user_id integer NOT NULL,
key character varying(255) NOT NULL,
source character varying(255),
actions integer DEFAULT 0 NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
comment text,
revoked boolean DEFAULT false NOT NULL,
revoked_at timestamp without time zone,
last_used_at timestamp without time zone
);
ALTER TABLE public.api_keys OWNER TO postgres;
--
-- Name: approved_labels; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.approved_labels (
id integer NOT NULL,
name character varying(255) NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
ALTER TABLE public.approved_labels OWNER TO postgres;
--
-- Name: approved_labels_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.approved_labels_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.approved_labels_id_seq OWNER TO postgres;
--
-- Name: approved_labels_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.approved_labels_id_seq OWNED BY public.approved_labels.id;
--
-- Name: dependencies; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.dependencies (
version_id integer NOT NULL,
dependency_name character varying(255) NOT NULL,
dependency character varying(255) NOT NULL
);
ALTER TABLE public.dependencies OWNER TO postgres;
--
-- Name: downloads_daily; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.downloads_daily (
version_id integer NOT NULL,
date date NOT NULL,
count integer DEFAULT 0 NOT NULL
);
ALTER TABLE public.downloads_daily OWNER TO postgres;
--
-- Name: exception_requests; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.exception_requests (
id integer NOT NULL,
exception_type_id integer NOT NULL,
path text,
method character varying(255),
referer text,
ip character varying(255),
data jsonb,
msg text NOT NULL,
trace text,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
ALTER TABLE public.exception_requests OWNER TO postgres;
--
-- Name: exception_requests_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.exception_requests_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.exception_requests_id_seq OWNER TO postgres;
--
-- Name: exception_requests_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.exception_requests_id_seq OWNED BY public.exception_requests.id;
--
-- Name: exception_types; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.exception_types (
id integer NOT NULL,
label text NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
count integer DEFAULT 0 NOT NULL,
status smallint DEFAULT 1 NOT NULL
);
ALTER TABLE public.exception_types OWNER TO postgres;
--
-- Name: exception_types_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.exception_types_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.exception_types_id_seq OWNER TO postgres;
--
-- Name: exception_types_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.exception_types_id_seq OWNED BY public.exception_types.id;
--
-- Name: followings; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.followings (
source_user_id integer NOT NULL,
object_type smallint NOT NULL,
object_id integer NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
type smallint DEFAULT 1 NOT NULL
);
ALTER TABLE public.followings OWNER TO postgres;
--
-- Name: github_accounts; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.github_accounts (
user_id integer NOT NULL,
github_login text NOT NULL,
github_user_id integer DEFAULT 0 NOT NULL,
access_token text NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
ALTER TABLE public.github_accounts OWNER TO postgres;
--
-- Name: lapis_migrations; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.lapis_migrations (
name character varying(255) NOT NULL
);
ALTER TABLE public.lapis_migrations OWNER TO postgres;
--
-- Name: linked_modules; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.linked_modules (
module_id integer NOT NULL,
user_id integer NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
ALTER TABLE public.linked_modules OWNER TO postgres;
--
-- Name: manifest_admins; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.manifest_admins (
user_id integer NOT NULL,
manifest_id integer NOT NULL,
is_owner boolean NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
ALTER TABLE public.manifest_admins OWNER TO postgres;
--
-- Name: manifest_backups; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.manifest_backups (
id integer NOT NULL,
manifest_id integer NOT NULL,
development boolean DEFAULT false,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
last_backup timestamp without time zone,
repository_url text NOT NULL
);
ALTER TABLE public.manifest_backups OWNER TO postgres;
--
-- Name: manifest_backups_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.manifest_backups_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.manifest_backups_id_seq OWNER TO postgres;
--
-- Name: manifest_backups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.manifest_backups_id_seq OWNED BY public.manifest_backups.id;
--
-- Name: manifest_modules; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.manifest_modules (
manifest_id integer NOT NULL,
module_id integer NOT NULL,
module_name character varying(255) NOT NULL
);
ALTER TABLE public.manifest_modules OWNER TO postgres;
--
-- Name: manifests; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.manifests (
id integer NOT NULL,
name character varying(255) NOT NULL,
is_open boolean NOT NULL,
display_name character varying(255),
description text,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
modules_count integer DEFAULT 0 NOT NULL,
versions_count integer DEFAULT 0 NOT NULL
);
ALTER TABLE public.manifests OWNER TO postgres;
--
-- Name: manifests_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.manifests_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.manifests_id_seq OWNER TO postgres;
--
-- Name: manifests_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.manifests_id_seq OWNED BY public.manifests.id;
--
-- Name: modules; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.modules (
id integer NOT NULL,
user_id integer NOT NULL,
name character varying(255) NOT NULL,
downloads integer DEFAULT 0 NOT NULL,
current_version_id integer NOT NULL,
summary character varying(255),
description text,
license character varying(255),
homepage character varying(255),
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
display_name character varying(255),
has_dev_version boolean DEFAULT false NOT NULL,
followers_count integer DEFAULT 0 NOT NULL,
labels text[],
stars_count integer DEFAULT 0 NOT NULL
);
ALTER TABLE public.modules OWNER TO postgres;
--
-- Name: modules_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.modules_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.modules_id_seq OWNER TO postgres;
--
-- Name: modules_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.modules_id_seq OWNED BY public.modules.id;
--
-- Name: notification_objects; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.notification_objects (
notification_id integer NOT NULL,
object_type smallint NOT NULL,
object_id integer NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
ALTER TABLE public.notification_objects OWNER TO postgres;
--
-- Name: notifications; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.notifications (
id integer NOT NULL,
user_id integer NOT NULL,
type integer DEFAULT 0 NOT NULL,
object_type smallint NOT NULL,
object_id integer NOT NULL,
count integer DEFAULT 0 NOT NULL,
seen boolean DEFAULT false NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
ALTER TABLE public.notifications OWNER TO postgres;
--
-- Name: notifications_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.notifications_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.notifications_id_seq OWNER TO postgres;
--
-- Name: notifications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.notifications_id_seq OWNED BY public.notifications.id;
--
-- Name: rocks; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.rocks (
id integer NOT NULL,
version_id integer NOT NULL,
arch character varying(255) NOT NULL,
downloads integer DEFAULT 0 NOT NULL,
rock_key character varying(255) NOT NULL,
rock_fname character varying(255) NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
revision integer DEFAULT 1 NOT NULL
);
ALTER TABLE public.rocks OWNER TO postgres;
--
-- Name: rocks_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.rocks_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.rocks_id_seq OWNER TO postgres;
--
-- Name: rocks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.rocks_id_seq OWNED BY public.rocks.id;
--
-- Name: user_activity_logs; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.user_activity_logs (
id integer NOT NULL,
user_id integer NOT NULL,
source smallint NOT NULL,
action text NOT NULL,
data json,
ip inet,
accept_lang text,
user_agent text,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
object_type smallint,
object_id integer
);
ALTER TABLE public.user_activity_logs OWNER TO postgres;
--
-- Name: user_activity_logs_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.user_activity_logs_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.user_activity_logs_id_seq OWNER TO postgres;
--
-- Name: user_activity_logs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.user_activity_logs_id_seq OWNED BY public.user_activity_logs.id;
--
-- Name: user_data; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.user_data (
user_id integer NOT NULL,
email_verified boolean DEFAULT false NOT NULL,
password_reset_token character varying(255),
twitter text,
website text,
profile text,
github text
);
ALTER TABLE public.user_data OWNER TO postgres;
--
-- Name: user_server_logs; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.user_server_logs (
id integer NOT NULL,
user_id integer,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
log_date timestamp without time zone NOT NULL,
log text NOT NULL,
data json
);
ALTER TABLE public.user_server_logs OWNER TO postgres;
--
-- Name: user_server_logs_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.user_server_logs_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.user_server_logs_id_seq OWNER TO postgres;
--
-- Name: user_server_logs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.user_server_logs_id_seq OWNED BY public.user_server_logs.id;
--
-- Name: user_sessions; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.user_sessions (
id integer NOT NULL,
user_id integer NOT NULL,
type smallint NOT NULL,
revoked boolean DEFAULT false NOT NULL,
ip inet NOT NULL,
accept_lang text,
user_agent text,
last_active_at timestamp without time zone,
revoked_at timestamp without time zone,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
ALTER TABLE public.user_sessions OWNER TO postgres;
--
-- Name: user_sessions_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.user_sessions_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.user_sessions_id_seq OWNER TO postgres;
--
-- Name: user_sessions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.user_sessions_id_seq OWNED BY public.user_sessions.id;
--
-- Name: user_sessions_user_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.user_sessions_user_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.user_sessions_user_id_seq OWNER TO postgres;
--
-- Name: user_sessions_user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.user_sessions_user_id_seq OWNED BY public.user_sessions.user_id;
--
-- Name: users; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.users (
id integer NOT NULL,
username character varying(255) NOT NULL,
encrypted_password character varying(255),
email character varying(255) NOT NULL,
slug character varying(255) NOT NULL,
flags integer DEFAULT 0 NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
following_count integer DEFAULT 0 NOT NULL,
modules_count integer DEFAULT 0 NOT NULL,
last_active_at timestamp without time zone,
followers_count integer DEFAULT 0 NOT NULL,
display_name character varying(255),
stared_count integer DEFAULT 0 NOT NULL
);
ALTER TABLE public.users OWNER TO postgres;
--
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.users_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.users_id_seq OWNER TO postgres;
--
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
--
-- Name: versions; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.versions (
id integer NOT NULL,
module_id integer NOT NULL,
version_name character varying(255) NOT NULL,
rockspec_key character varying(255) NOT NULL,
rockspec_fname character varying(255) NOT NULL,
downloads integer DEFAULT 0 NOT NULL,
rockspec_downloads integer DEFAULT 0 NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
display_version_name character varying(255),
lua_version character varying(255),
development boolean DEFAULT false NOT NULL,
source_url text,
revision integer DEFAULT 1 NOT NULL,
external_rockspec_url text,
archived boolean DEFAULT false NOT NULL
);
ALTER TABLE public.versions OWNER TO postgres;
--
-- Name: versions_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.versions_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.versions_id_seq OWNER TO postgres;
--
-- Name: versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.versions_id_seq OWNED BY public.versions.id;
--
-- Name: approved_labels id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.approved_labels ALTER COLUMN id SET DEFAULT nextval('public.approved_labels_id_seq'::regclass);
--
-- Name: exception_requests id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.exception_requests ALTER COLUMN id SET DEFAULT nextval('public.exception_requests_id_seq'::regclass);
--
-- Name: exception_types id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.exception_types ALTER COLUMN id SET DEFAULT nextval('public.exception_types_id_seq'::regclass);
--
-- Name: manifest_backups id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.manifest_backups ALTER COLUMN id SET DEFAULT nextval('public.manifest_backups_id_seq'::regclass);
--
-- Name: manifests id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.manifests ALTER COLUMN id SET DEFAULT nextval('public.manifests_id_seq'::regclass);
--
-- Name: modules id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.modules ALTER COLUMN id SET DEFAULT nextval('public.modules_id_seq'::regclass);
--
-- Name: notifications id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.notifications ALTER COLUMN id SET DEFAULT nextval('public.notifications_id_seq'::regclass);
--
-- Name: rocks id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.rocks ALTER COLUMN id SET DEFAULT nextval('public.rocks_id_seq'::regclass);
--
-- Name: user_activity_logs id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.user_activity_logs ALTER COLUMN id SET DEFAULT nextval('public.user_activity_logs_id_seq'::regclass);
--
-- Name: user_server_logs id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.user_server_logs ALTER COLUMN id SET DEFAULT nextval('public.user_server_logs_id_seq'::regclass);
--
-- Name: user_sessions id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.user_sessions ALTER COLUMN id SET DEFAULT nextval('public.user_sessions_id_seq'::regclass);
--
-- Name: user_sessions user_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.user_sessions ALTER COLUMN user_id SET DEFAULT nextval('public.user_sessions_user_id_seq'::regclass);
--
-- Name: users id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);
--
-- Name: versions id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.versions ALTER COLUMN id SET DEFAULT nextval('public.versions_id_seq'::regclass);
--
-- Name: api_keys api_keys_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.api_keys
ADD CONSTRAINT api_keys_pkey PRIMARY KEY (key);
--
-- Name: approved_labels approved_labels_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.approved_labels
ADD CONSTRAINT approved_labels_pkey PRIMARY KEY (id);
--
-- Name: dependencies dependencies_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.dependencies
ADD CONSTRAINT dependencies_pkey PRIMARY KEY (version_id, dependency_name);
--
-- Name: downloads_daily downloads_daily_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.downloads_daily
ADD CONSTRAINT downloads_daily_pkey PRIMARY KEY (version_id, date);
--
-- Name: exception_requests exception_requests_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.exception_requests
ADD CONSTRAINT exception_requests_pkey PRIMARY KEY (id);
--
-- Name: exception_types exception_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.exception_types
ADD CONSTRAINT exception_types_pkey PRIMARY KEY (id);
--
-- Name: followings followings_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.followings
ADD CONSTRAINT followings_pkey PRIMARY KEY (source_user_id, object_type, object_id, type);
--
-- Name: github_accounts github_accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.github_accounts
ADD CONSTRAINT github_accounts_pkey PRIMARY KEY (user_id, github_user_id);
--
-- Name: lapis_migrations lapis_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.lapis_migrations
ADD CONSTRAINT lapis_migrations_pkey PRIMARY KEY (name);
--
-- Name: linked_modules linked_modules_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.linked_modules
ADD CONSTRAINT linked_modules_pkey PRIMARY KEY (module_id, user_id);
--
-- Name: manifest_admins manifest_admins_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.manifest_admins
ADD CONSTRAINT manifest_admins_pkey PRIMARY KEY (user_id, manifest_id);
--
-- Name: manifest_backups manifest_backups_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.manifest_backups
ADD CONSTRAINT manifest_backups_pkey PRIMARY KEY (id);
--
-- Name: manifest_modules manifest_modules_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.manifest_modules
ADD CONSTRAINT manifest_modules_pkey PRIMARY KEY (manifest_id, module_id);
--
-- Name: manifests manifests_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.manifests
ADD CONSTRAINT manifests_pkey PRIMARY KEY (id);
--
-- Name: modules modules_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.modules
ADD CONSTRAINT modules_pkey PRIMARY KEY (id);
--
-- Name: notification_objects notification_objects_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.notification_objects
ADD CONSTRAINT notification_objects_pkey PRIMARY KEY (notification_id, object_type, object_id);
--
-- Name: notifications notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres