This repository was archived by the owner on Jan 11, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathboosty.sql
More file actions
225 lines (199 loc) · 6.38 KB
/
boosty.sql
File metadata and controls
225 lines (199 loc) · 6.38 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
/*
Navicat Premium Data Transfer
Source Server : timeweb-ss14
Source Server Type : PostgreSQL
Source Server Version : 130003 (130003)
Source Host : 80.90.185.209:5432
Source Catalog : default_db
Source Schema : boosty
Target Server Type : PostgreSQL
Target Server Version : 130003 (130003)
File Encoding : 65001
Date: 20/04/2024 00:27:30
*/
-- ----------------------------
-- Sequence structure for discord_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "boosty"."discord_id_seq";
CREATE SEQUENCE "boosty"."discord_id_seq"
INCREMENT 1
MINVALUE 1
MAXVALUE 2147483647
START 1
CACHE 1;
-- ----------------------------
-- Sequence structure for discord_id_seq1
-- ----------------------------
DROP SEQUENCE IF EXISTS "boosty"."discord_id_seq1";
CREATE SEQUENCE "boosty"."discord_id_seq1"
INCREMENT 1
MINVALUE 1
MAXVALUE 2147483647
START 1
CACHE 1;
-- ----------------------------
-- Sequence structure for discord_id_seq2
-- ----------------------------
DROP SEQUENCE IF EXISTS "boosty"."discord_id_seq2";
CREATE SEQUENCE "boosty"."discord_id_seq2"
INCREMENT 1
MINVALUE 1
MAXVALUE 2147483647
START 1
CACHE 1;
-- ----------------------------
-- Sequence structure for prime_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "boosty"."prime_id_seq";
CREATE SEQUENCE "boosty"."prime_id_seq"
INCREMENT 1
MINVALUE 1
MAXVALUE 2147483647
START 1
CACHE 1;
-- ----------------------------
-- Sequence structure for prime_id_seq1
-- ----------------------------
DROP SEQUENCE IF EXISTS "boosty"."prime_id_seq1";
CREATE SEQUENCE "boosty"."prime_id_seq1"
INCREMENT 1
MINVALUE 1
MAXVALUE 2147483647
START 1
CACHE 1;
-- ----------------------------
-- Sequence structure for prime_id_seq2
-- ----------------------------
DROP SEQUENCE IF EXISTS "boosty"."prime_id_seq2";
CREATE SEQUENCE "boosty"."prime_id_seq2"
INCREMENT 1
MINVALUE 1
MAXVALUE 2147483647
START 1
CACHE 1;
-- ----------------------------
-- Table structure for discord
-- ----------------------------
DROP TABLE IF EXISTS "boosty"."discord";
CREATE TABLE "boosty"."discord" (
"id" int4 NOT NULL GENERATED BY DEFAULT AS IDENTITY (
INCREMENT 1
MINVALUE 1
MAXVALUE 2147483647
START 1
CACHE 1
),
"ss14" uuid,
"discord" numeric(64,0)
)
;
-- ----------------------------
-- Table structure for personal
-- ----------------------------
DROP TABLE IF EXISTS "boosty"."personal";
CREATE TABLE "boosty"."personal" (
"id" uuid NOT NULL DEFAULT gen_random_uuid(),
"user" uuid NOT NULL,
"item" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
"expire" timestamptz(6)
)
;
-- ----------------------------
-- Table structure for prime
-- ----------------------------
DROP TABLE IF EXISTS "boosty"."prime";
CREATE TABLE "boosty"."prime" (
"id" int4 NOT NULL GENERATED BY DEFAULT AS IDENTITY (
INCREMENT 1
MINVALUE 1
MAXVALUE 2147483647
START 1
CACHE 1
),
"username" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
"expire" timestamp(6),
"tier" int2 NOT NULL DEFAULT 1,
"color" varchar(255) COLLATE "pg_catalog"."default",
"comment" text COLLATE "pg_catalog"."default"
)
;
-- ----------------------------
-- View structure for active_pers
-- ----------------------------
DROP VIEW IF EXISTS "boosty"."active_pers";
CREATE VIEW "boosty"."active_pers" AS SELECT personal."user",
personal.item
FROM boosty.personal
WHERE personal.expire >= now() OR personal.expire IS NULL;
-- ----------------------------
-- View structure for active_user
-- ----------------------------
DROP VIEW IF EXISTS "boosty"."active_user";
CREATE VIEW "boosty"."active_user" AS SELECT prime.tier,
prime.username,
prime.color
FROM boosty.prime
WHERE prime.expire >= now() OR prime.expire IS NULL;
-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "boosty"."discord_id_seq"
OWNED BY "boosty"."discord"."id";
SELECT setval('"boosty"."discord_id_seq"', 900, true);
-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "boosty"."discord_id_seq1"
OWNED BY "boosty"."discord"."id";
SELECT setval('"boosty"."discord_id_seq1"', 900, true);
-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "boosty"."discord_id_seq2"
OWNED BY "boosty"."discord"."id";
SELECT setval('"boosty"."discord_id_seq2"', 5175, true);
-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "boosty"."prime_id_seq"
OWNED BY "boosty"."prime"."id";
SELECT setval('"boosty"."prime_id_seq"', 28575, true);
-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "boosty"."prime_id_seq1"
OWNED BY "boosty"."prime"."id";
SELECT setval('"boosty"."prime_id_seq1"', 28575, true);
-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "boosty"."prime_id_seq2"
OWNED BY "boosty"."prime"."id";
SELECT setval('"boosty"."prime_id_seq2"', 496194, true);
-- ----------------------------
-- Indexes structure for table discord
-- ----------------------------
CREATE UNIQUE INDEX "discord_discord_idx" ON "boosty"."discord" USING btree (
"discord" "pg_catalog"."numeric_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "discord_ss14_idx" ON "boosty"."discord" USING btree (
"ss14" "pg_catalog"."uuid_ops" ASC NULLS LAST
);
-- ----------------------------
-- Primary Key structure for table discord
-- ----------------------------
ALTER TABLE "boosty"."discord" ADD CONSTRAINT "discord_pkey" PRIMARY KEY ("id");
-- ----------------------------
-- Primary Key structure for table personal
-- ----------------------------
ALTER TABLE "boosty"."personal" ADD CONSTRAINT "personal_pkey" PRIMARY KEY ("id");
-- ----------------------------
-- Indexes structure for table prime
-- ----------------------------
CREATE UNIQUE INDEX "prime_username_idx" ON "boosty"."prime" USING btree (
"username" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
-- ----------------------------
-- Primary Key structure for table prime
-- ----------------------------
ALTER TABLE "boosty"."prime" ADD CONSTRAINT "prime_pkey" PRIMARY KEY ("id");