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
|
-- WARNING: This schema is for context only and is not meant to be run.
-- Table order and constraints may not be valid for execution.
CREATE TABLE public.badges (
id bigint GENERATED ALWAYS AS IDENTITY NOT NULL,
created_at timestamp with time zone NOT NULL DEFAULT (now() AT TIME ZONE 'utc'::text),
updated_at timestamp with time zone,
image_url text NOT NULL,
image_artist text,
description text,
event bigint NOT NULL,
group bigint NOT NULL,
CONSTRAINT badges_pkey PRIMARY KEY (id),
CONSTRAINT badges_event_fkey FOREIGN KEY (event) REFERENCES public.events(id),
CONSTRAINT badges_group_fkey FOREIGN KEY (group) REFERENCES public.groups(id)
);
CREATE TABLE public.events (
id bigint GENERATED ALWAYS AS IDENTITY NOT NULL,
created_at timestamp with time zone NOT NULL DEFAULT (now() AT TIME ZONE 'utc'::text),
updated_at timestamp with time zone,
title text NOT NULL UNIQUE,
description text,
group text NOT NULL,
banner text NOT NULL,
anilist_url text NOT NULL,
alternative_banners ARRAY,
CONSTRAINT events_pkey PRIMARY KEY (id),
CONSTRAINT public_events_group_fkey FOREIGN KEY (group) REFERENCES public.groups(anilist_username)
);
CREATE TABLE public.groups (
id bigint GENERATED ALWAYS AS IDENTITY NOT NULL,
created_at timestamp with time zone NOT NULL DEFAULT (now() AT TIME ZONE 'utc'::text),
updated_at timestamp with time zone,
members ARRAY,
avatar text NOT NULL,
banner text NOT NULL,
description text,
name text NOT NULL UNIQUE,
anilist_id bigint NOT NULL UNIQUE,
anilist_username text NOT NULL DEFAULT ''::text UNIQUE,
badge text,
badge_description text,
CONSTRAINT groups_pkey PRIMARY KEY (id)
);
CREATE TABLE public.user_badges (
id bigint GENERATED ALWAYS AS IDENTITY NOT NULL,
user_id bigint NOT NULL,
post text NOT NULL,
image text NOT NULL,
description text,
time timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
category text,
hidden boolean NOT NULL DEFAULT false,
source text,
designer text,
shadow_hidden boolean NOT NULL DEFAULT false,
click_count bigint NOT NULL DEFAULT '0'::bigint,
CONSTRAINT user_badges_pkey PRIMARY KEY (id)
);
CREATE TABLE public.user_configuration (
id bigint GENERATED ALWAYS AS IDENTITY NOT NULL UNIQUE,
user_id bigint NOT NULL UNIQUE,
created_at timestamp without time zone NOT NULL DEFAULT now(),
updated_at timestamp without time zone,
configuration jsonb,
CONSTRAINT user_configuration_pkey PRIMARY KEY (id)
);
CREATE TABLE public.user_notifications (
id bigint GENERATED ALWAYS AS IDENTITY NOT NULL,
created_at timestamp with time zone NOT NULL DEFAULT (now() AT TIME ZONE 'utc'::text),
updated_at timestamp with time zone NOT NULL DEFAULT (now() AT TIME ZONE 'utc'::text),
user_id bigint NOT NULL UNIQUE,
subscription json NOT NULL,
fingerprint text NOT NULL,
CONSTRAINT user_notifications_pkey PRIMARY KEY (id)
);
CREATE TABLE public.user_preferences (
id bigint GENERATED ALWAYS AS IDENTITY NOT NULL,
created_at timestamp with time zone NOT NULL DEFAULT now(),
updated_at timestamp with time zone,
pinned_hololive_streams ARRAY NOT NULL DEFAULT '{}'::text[],
hide_missing_badges boolean NOT NULL DEFAULT false,
user_id bigint NOT NULL UNIQUE,
biography text,
badge_wall_css text NOT NULL DEFAULT ''::text,
hide_awc_badges boolean NOT NULL DEFAULT false,
pinned_badge_wall_categories ARRAY DEFAULT '{}'::text[],
CONSTRAINT user_preferences_pkey PRIMARY KEY (id)
);
CREATE TABLE public.user_tracker (
id bigint GENERATED ALWAYS AS IDENTITY NOT NULL,
user_id bigint NOT NULL,
created_at timestamp with time zone NOT NULL DEFAULT now(),
updated_at timestamp with time zone NOT NULL DEFAULT now(),
url text NOT NULL,
title text NOT NULL,
progress bigint NOT NULL DEFAULT '0'::bigint,
CONSTRAINT user_tracker_pkey PRIMARY KEY (id)
);
|