This repository was archived by the owner on Jun 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdecert.sql
More file actions
418 lines (283 loc) · 9.2 KB
/
Copy pathdecert.sql
File metadata and controls
418 lines (283 loc) · 9.2 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
--
-- PostgreSQL database dump
--
-- Dumped from database version 14.6
-- Dumped by pg_dump version 14.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;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: claim_badge_tweet; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.claim_badge_tweet (
id integer NOT NULL,
address character varying NOT NULL,
"tokenId" character varying NOT NULL,
url character varying NOT NULL,
add_ts bigint NOT NULL,
airdroped boolean DEFAULT false NOT NULL,
airdrop_ts bigint DEFAULT 0,
airdrop_hash character varying DEFAULT ''::character varying
);
--
-- Name: COLUMN claim_badge_tweet.address; Type: COMMENT; Schema: public; Owner: -
--
COMMENT ON COLUMN public.claim_badge_tweet.address IS '用户钱包地址';
--
-- Name: COLUMN claim_badge_tweet."tokenId"; Type: COMMENT; Schema: public; Owner: -
--
COMMENT ON COLUMN public.claim_badge_tweet."tokenId" IS 'badgeNFT tokenId';
--
-- Name: COLUMN claim_badge_tweet.url; Type: COMMENT; Schema: public; Owner: -
--
COMMENT ON COLUMN public.claim_badge_tweet.url IS '推文链接地址';
--
-- Name: COLUMN claim_badge_tweet.add_ts; Type: COMMENT; Schema: public; Owner: -
--
COMMENT ON COLUMN public.claim_badge_tweet.add_ts IS '添加时的时间戳';
--
-- Name: COLUMN claim_badge_tweet.airdrop_ts; Type: COMMENT; Schema: public; Owner: -
--
COMMENT ON COLUMN public.claim_badge_tweet.airdrop_ts IS '空投时间';
--
-- Name: claim_badge_tweet_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.claim_badge_tweet_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: claim_badge_tweet_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.claim_badge_tweet_id_seq OWNED BY public.claim_badge_tweet.id;
--
-- Name: events_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.events_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: events; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.events (
id integer DEFAULT nextval('public.events_id_seq'::regclass) NOT NULL,
type character varying DEFAULT ''::character varying NOT NULL,
"timestamp" bigint NOT NULL,
signature character varying DEFAULT ''::character varying NOT NULL,
payload jsonb
);
--
-- Name: quest_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.quest_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: quest; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.quest (
id integer DEFAULT nextval('public.quest_id_seq'::regclass) NOT NULL,
title character varying DEFAULT ''::character varying NOT NULL,
label character varying DEFAULT ''::character varying NOT NULL,
disabled boolean DEFAULT false NOT NULL,
description character varying DEFAULT ''::character varying NOT NULL,
dependencies jsonb,
"isDraft" boolean DEFAULT true NOT NULL,
"addTs" bigint,
"tokenId" character varying,
type smallint DEFAULT 0,
difficulty smallint,
"estimateTime" smallint,
creator character varying NOT NULL,
metadata jsonb,
extradata jsonb,
uri character varying
);
--
-- Name: COLUMN quest.type; Type: COMMENT; Schema: public; Owner: -
--
COMMENT ON COLUMN public.quest.type IS '0:问答;1:编程';
--
-- Name: COLUMN quest.difficulty; Type: COMMENT; Schema: public; Owner: -
--
COMMENT ON COLUMN public.quest.difficulty IS '0:easy;1:moderate;2:difficult';
--
-- Name: COLUMN quest."estimateTime"; Type: COMMENT; Schema: public; Owner: -
--
COMMENT ON COLUMN public.quest."estimateTime" IS '预估时间/min';
--
-- Name: COLUMN quest.creator; Type: COMMENT; Schema: public; Owner: -
--
COMMENT ON COLUMN public.quest.creator IS 'user address';
--
-- Name: COLUMN quest.metadata; Type: COMMENT; Schema: public; Owner: -
--
COMMENT ON COLUMN public.quest.metadata IS '元数据';
--
-- Name: COLUMN quest.extradata; Type: COMMENT; Schema: public; Owner: -
--
COMMENT ON COLUMN public.quest.extradata IS '额外数据';
--
-- Name: transaction_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.transaction_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: transaction; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.transaction (
id integer DEFAULT nextval('public.transaction_id_seq'::regclass) NOT NULL,
hash character varying NOT NULL,
add_time timestamp without time zone DEFAULT now() NOT NULL,
remark character varying,
status smallint DEFAULT '-1'::integer NOT NULL,
receipt jsonb
);
--
-- Name: COLUMN transaction.hash; Type: COMMENT; Schema: public; Owner: -
--
COMMENT ON COLUMN public.transaction.hash IS '交易哈希';
--
-- Name: user_challenges_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.user_challenges_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: user_challenges; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.user_challenges (
id integer DEFAULT nextval('public.user_challenges_id_seq'::regclass) NOT NULL,
address character varying DEFAULT ''::character varying NOT NULL,
"questId" integer NOT NULL,
status smallint DEFAULT 0,
content jsonb,
add_ts bigint NOT NULL,
claimed boolean DEFAULT false NOT NULL,
update_ts bigint,
claim_ts bigint
);
--
-- Name: COLUMN user_challenges.status; Type: COMMENT; Schema: public; Owner: -
--
COMMENT ON COLUMN public.user_challenges.status IS '0:进行中;1:等待验证;2:成功;';
--
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.users_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: users; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.users (
id integer DEFAULT nextval('public.users_id_seq'::regclass) NOT NULL,
address character varying DEFAULT ''::character varying NOT NULL,
"creationTimestamp" bigint NOT NULL,
socials jsonb
);
--
-- Name: COLUMN users.address; Type: COMMENT; Schema: public; Owner: -
--
COMMENT ON COLUMN public.users.address IS '钱包地址';
--
-- Name: COLUMN users."creationTimestamp"; Type: COMMENT; Schema: public; Owner: -
--
COMMENT ON COLUMN public.users."creationTimestamp" IS '创建时间';
--
-- Name: COLUMN users.socials; Type: COMMENT; Schema: public; Owner: -
--
COMMENT ON COLUMN public.users.socials IS '社交账号';
--
-- Name: claim_badge_tweet id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.claim_badge_tweet ALTER COLUMN id SET DEFAULT nextval('public.claim_badge_tweet_id_seq'::regclass);
--
-- Name: claim_badge_tweet claim_badge_tweet_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.claim_badge_tweet
ADD CONSTRAINT claim_badge_tweet_pkey PRIMARY KEY (id);
--
-- Name: events events_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.events
ADD CONSTRAINT events_pkey PRIMARY KEY (id);
--
-- Name: quest quest_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.quest
ADD CONSTRAINT quest_pkey PRIMARY KEY (id);
--
-- Name: transaction transaction_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.transaction
ADD CONSTRAINT transaction_pkey PRIMARY KEY (id);
--
-- Name: user_challenges user_challenges_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.user_challenges
ADD CONSTRAINT user_challenges_pkey PRIMARY KEY (id);
--
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.users
ADD CONSTRAINT users_pkey PRIMARY KEY (id);
--
-- Name: address; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX address ON public.users USING btree (address);
--
-- Name: claim_badge_tweet_url; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX claim_badge_tweet_url ON public.claim_badge_tweet USING btree (url);
--
-- Name: quest_title; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX quest_title ON public.quest USING btree (title);
--
-- Name: quest_tokenId; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX "quest_tokenId" ON public.quest USING btree ("tokenId");
--
-- Name: transaction_hash; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX transaction_hash ON public.transaction USING btree (hash);
--
-- Name: user_challenges_address; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX user_challenges_address ON public.user_challenges USING btree (address);
--
-- Name: user_challenges_questId; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX "user_challenges_questId" ON public.user_challenges USING btree ("questId");
--
-- PostgreSQL database dump complete
--