-
Notifications
You must be signed in to change notification settings - Fork 18
/
pg_schema.sql
1020 lines (679 loc) · 22.4 KB
/
pg_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 12.2
-- Dumped by pg_dump version 12.2
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;
--
-- Roles
--
DROP ROLE IF EXISTS "z-blog";
CREATE ROLE "z-blog";
ALTER ROLE "z-blog" WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS;
DROP DATABASE IF EXISTS "z-blog";
--
-- Name: z-blog; Type: DATABASE; Schema: -; Owner: z-blog
--
CREATE DATABASE "z-blog" WITH TEMPLATE = template0 ENCODING = 'UTF8';
ALTER DATABASE "z-blog" OWNER TO "z-blog";
\connect -reuse-previous=on "dbname='z-blog'"
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: dashboard_user; Type: TABLE; Schema: public; Owner: z-blog
--
CREATE TABLE public.dashboard_user (
id integer NOT NULL,
username text NOT NULL,
password text NOT NULL,
roles text[] NOT NULL,
create_ts timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
update_ts timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
status smallint DEFAULT 0 NOT NULL
);
ALTER TABLE public.dashboard_user OWNER TO "z-blog";
--
-- Name: TABLE dashboard_user; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON TABLE public.dashboard_user IS '管理系统用户';
--
-- Name: dashboard_user_id_seq; Type: SEQUENCE; Schema: public; Owner: z-blog
--
CREATE SEQUENCE public.dashboard_user_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.dashboard_user_id_seq OWNER TO "z-blog";
--
-- Name: dashboard_user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: z-blog
--
ALTER SEQUENCE public.dashboard_user_id_seq OWNED BY public.dashboard_user.id;
--
-- Name: english; Type: TABLE; Schema: public; Owner: z-blog
--
CREATE TABLE public.english (
id integer NOT NULL,
word text NOT NULL,
english_phonetic text,
american_phonetic text,
translation jsonb NOT NULL,
example_sentence text,
sentence_translation text,
source text,
synonyms text,
create_ts timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
update_ts timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
);
ALTER TABLE public.english OWNER TO "z-blog";
--
-- Name: TABLE english; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON TABLE public.english IS '英语角';
--
-- Name: english_id_seq; Type: SEQUENCE; Schema: public; Owner: z-blog
--
CREATE SEQUENCE public.english_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.english_id_seq OWNER TO "z-blog";
--
-- Name: english_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: z-blog
--
ALTER SEQUENCE public.english_id_seq OWNED BY public.english.id;
--
-- Name: ip_pool; Type: TABLE; Schema: public; Owner: z-blog
--
CREATE TABLE public.ip_pool (
id integer NOT NULL,
ip inet NOT NULL,
country text,
region text,
city text,
isp text,
country_id text,
region_id text,
city_id text,
isp_id text,
create_ts timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
update_ts timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
);
ALTER TABLE public.ip_pool OWNER TO "z-blog";
--
-- Name: TABLE ip_pool; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON TABLE public.ip_pool IS 'IP池';
--
-- Name: COLUMN ip_pool.ip; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.ip_pool.ip IS 'IP地址';
--
-- Name: COLUMN ip_pool.country; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.ip_pool.country IS '国家';
--
-- Name: COLUMN ip_pool.region; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.ip_pool.region IS '地区';
--
-- Name: COLUMN ip_pool.city; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.ip_pool.city IS '城市';
--
-- Name: COLUMN ip_pool.isp; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.ip_pool.isp IS 'ip服务商';
--
-- Name: COLUMN ip_pool.country_id; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.ip_pool.country_id IS '国家id';
--
-- Name: COLUMN ip_pool.region_id; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.ip_pool.region_id IS '地区id';
--
-- Name: COLUMN ip_pool.city_id; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.ip_pool.city_id IS '城市码';
--
-- Name: COLUMN ip_pool.isp_id; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.ip_pool.isp_id IS 'ip服务商id';
--
-- Name: COLUMN ip_pool.create_ts; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.ip_pool.create_ts IS '创建时间';
--
-- Name: COLUMN ip_pool.update_ts; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.ip_pool.update_ts IS '更新时间';
--
-- Name: ip_pool_id_seq; Type: SEQUENCE; Schema: public; Owner: z-blog
--
CREATE SEQUENCE public.ip_pool_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.ip_pool_id_seq OWNER TO "z-blog";
--
-- Name: ip_pool_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: z-blog
--
ALTER SEQUENCE public.ip_pool_id_seq OWNED BY public.ip_pool.id;
--
-- Name: ip_unknown; Type: TABLE; Schema: public; Owner: z-blog
--
CREATE TABLE public.ip_unknown (
ip text NOT NULL,
create_ts timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
update_ts timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
);
ALTER TABLE public.ip_unknown OWNER TO "z-blog";
--
-- Name: TABLE ip_unknown; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON TABLE public.ip_unknown IS '未知IP';
--
-- Name: link; Type: TABLE; Schema: public; Owner: z-blog
--
CREATE TABLE public.link (
id integer NOT NULL,
website text NOT NULL,
url text NOT NULL,
webmaster text NOT NULL,
webmaster_email text,
status smallint DEFAULT 0 NOT NULL,
create_ts timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
update_ts timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
sort smallint DEFAULT 0 NOT NULL
);
ALTER TABLE public.link OWNER TO "z-blog";
--
-- Name: TABLE link; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON TABLE public.link IS '友链';
--
-- Name: COLUMN link.webmaster; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.link.webmaster IS '站长';
--
-- Name: COLUMN link.status; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.link.status IS '友链状态(0:普通,1:下线)';
--
-- Name: COLUMN link.sort; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.link.sort IS '排序';
--
-- Name: link_id_seq; Type: SEQUENCE; Schema: public; Owner: z-blog
--
CREATE SEQUENCE public.link_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.link_id_seq OWNER TO "z-blog";
--
-- Name: link_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: z-blog
--
ALTER SEQUENCE public.link_id_seq OWNED BY public.link.id;
--
-- Name: message_board; Type: TABLE; Schema: public; Owner: z-blog
--
CREATE TABLE public.message_board (
id integer NOT NULL,
nickname text NOT NULL,
content text NOT NULL,
floor integer,
create_ts timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
update_ts timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
status smallint DEFAULT 0 NOT NULL,
ua text,
os text,
browser text,
replies jsonb,
ip_id bigint DEFAULT 0 NOT NULL,
reply_id integer,
root_id integer,
like_count integer DEFAULT 0 NOT NULL,
reply_count integer DEFAULT 0 NOT NULL
);
ALTER TABLE public.message_board OWNER TO "z-blog";
--
-- Name: TABLE message_board; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON TABLE public.message_board IS '留言板';
--
-- Name: COLUMN message_board.status; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.message_board.status IS '评论状态(0:正常,1:删除)';
--
-- Name: message_board_id_seq; Type: SEQUENCE; Schema: public; Owner: z-blog
--
CREATE SEQUENCE public.message_board_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.message_board_id_seq OWNER TO "z-blog";
--
-- Name: message_board_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: z-blog
--
ALTER SEQUENCE public.message_board_id_seq OWNED BY public.message_board.id;
--
-- Name: post; Type: TABLE; Schema: public; Owner: z-blog
--
CREATE TABLE public.post (
id integer NOT NULL,
uid integer DEFAULT 0 NOT NULL,
title text NOT NULL,
description text NOT NULL,
topics text[],
content text NOT NULL,
content_html text NOT NULL,
word_count integer DEFAULT 0 NOT NULL,
prop smallint DEFAULT 0 NOT NULL,
post_status smallint DEFAULT 0 NOT NULL,
pv integer DEFAULT 0 NOT NULL,
like_count integer DEFAULT 0 NOT NULL,
comment_count integer DEFAULT 0 NOT NULL,
comment_status smallint DEFAULT 0 NOT NULL,
create_ts timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
update_ts timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
post_comment jsonb,
post_like jsonb,
keywords text
);
ALTER TABLE public.post OWNER TO "z-blog";
--
-- Name: TABLE post; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON TABLE public.post IS '文章';
--
-- Name: COLUMN post.id; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.post.id IS '文章id';
--
-- Name: COLUMN post.uid; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.post.uid IS '文章所属用户id';
--
-- Name: COLUMN post.title; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.post.title IS '文章标题';
--
-- Name: COLUMN post.description; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.post.description IS '文章描述';
--
-- Name: COLUMN post.topics; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.post.topics IS '标签数组';
--
-- Name: COLUMN post.content; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.post.content IS '文章内容(Markdown)';
--
-- Name: COLUMN post.content_html; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.post.content_html IS '文章内容(HTML)';
--
-- Name: COLUMN post.word_count; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.post.word_count IS '文章字数';
--
-- Name: COLUMN post.prop; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.post.prop IS '是否转载(0:原创,1:转载)';
--
-- Name: COLUMN post.post_status; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.post.post_status IS '文章状态(0:普通,1:下线,2:私有)';
--
-- Name: COLUMN post.pv; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.post.pv IS '浏览量';
--
-- Name: COLUMN post.like_count; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.post.like_count IS '点赞数';
--
-- Name: COLUMN post.comment_count; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.post.comment_count IS '评论总数';
--
-- Name: COLUMN post.comment_status; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.post.comment_status IS '可否评论(0:打开,1:关闭)';
--
-- Name: COLUMN post.create_ts; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.post.create_ts IS '发布时间';
--
-- Name: COLUMN post.update_ts; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.post.update_ts IS '更新时间';
--
-- Name: COLUMN post.keywords; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.post.keywords IS '关键词';
--
-- Name: post_comment_id_seq; Type: SEQUENCE; Schema: public; Owner: z-blog
--
CREATE SEQUENCE public.post_comment_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.post_comment_id_seq OWNER TO "z-blog";
--
-- Name: post_like_id_seq; Type: SEQUENCE; Schema: public; Owner: z-blog
--
CREATE SEQUENCE public.post_like_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.post_like_id_seq OWNER TO "z-blog";
--
-- Name: record_invalid_request_id_seq; Type: SEQUENCE; Schema: public; Owner: z-blog
--
CREATE SEQUENCE public.record_invalid_request_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.record_invalid_request_id_seq OWNER TO "z-blog";
--
-- Name: record_invalid_request; Type: TABLE; Schema: public; Owner: z-blog
--
CREATE TABLE public.record_invalid_request (
id bigint DEFAULT nextval('public.record_invalid_request_id_seq'::regclass) NOT NULL,
url text NOT NULL,
req_method smallint,
req_param text,
ua text,
browser text,
browser_platform text,
browser_version text,
browser_vendor text,
os text,
os_version text,
referer text,
create_ts timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
cost_time numeric(6,2),
ip_id bigint,
source smallint DEFAULT 0 NOT NULL
);
ALTER TABLE public.record_invalid_request OWNER TO "z-blog";
--
-- Name: TABLE record_invalid_request; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON TABLE public.record_invalid_request IS '不合法请求记录';
--
-- Name: COLUMN record_invalid_request.req_method; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.record_invalid_request.req_method IS '请求方法(0:GET,1:POST,2:PUT,3:DELETE,4:OPTION)';
--
-- Name: COLUMN record_invalid_request.browser_vendor; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.record_invalid_request.browser_vendor IS '浏览器-制造商';
--
-- Name: COLUMN record_invalid_request.source; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.record_invalid_request.source IS '0:网站,1:微信小程序';
--
-- Name: record_page_view_id_seq; Type: SEQUENCE; Schema: public; Owner: z-blog
--
CREATE SEQUENCE public.record_page_view_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.record_page_view_id_seq OWNER TO "z-blog";
--
-- Name: record_page_view; Type: TABLE; Schema: public; Owner: z-blog
--
CREATE TABLE public.record_page_view (
id bigint DEFAULT nextval('public.record_page_view_id_seq'::regclass) NOT NULL,
url text NOT NULL,
req_method smallint,
req_param text,
ua text,
browser text,
browser_platform text,
browser_version text,
browser_vendor text,
os text,
os_version text,
referer text,
create_ts timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
cost_time numeric(6,2),
ip_id bigint,
source smallint DEFAULT 0 NOT NULL
);
ALTER TABLE public.record_page_view OWNER TO "z-blog";
--
-- Name: TABLE record_page_view; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON TABLE public.record_page_view IS '访问记录';
--
-- Name: COLUMN record_page_view.req_method; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.record_page_view.req_method IS '请求方法(0:GET,1:POST,2:PUT,3:DELETE,4:OPTION)';
--
-- Name: COLUMN record_page_view.browser_vendor; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.record_page_view.browser_vendor IS '浏览器-制造商';
--
-- Name: COLUMN record_page_view.source; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON COLUMN public.record_page_view.source IS '0:网站,1:微信小程序';
--
-- Name: record_search; Type: TABLE; Schema: public; Owner: z-blog
--
CREATE TABLE public.record_search (
id integer NOT NULL,
keywords text NOT NULL,
took integer DEFAULT 0,
hits integer DEFAULT 0,
referer text,
browser text,
os text,
create_ts timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
ip_id bigint,
ua text
);
ALTER TABLE public.record_search OWNER TO "z-blog";
--
-- Name: TABLE record_search; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON TABLE public.record_search IS '搜索记录';
--
-- Name: record_search_id_seq; Type: SEQUENCE; Schema: public; Owner: z-blog
--
CREATE SEQUENCE public.record_search_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.record_search_id_seq OWNER TO "z-blog";
--
-- Name: record_search_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: z-blog
--
ALTER SEQUENCE public.record_search_id_seq OWNED BY public.record_search.id;
--
-- Name: topic; Type: TABLE; Schema: public; Owner: z-blog
--
CREATE TABLE public.topic (
id integer NOT NULL,
name text NOT NULL,
sort integer DEFAULT 0 NOT NULL,
create_ts timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
update_ts timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
);
ALTER TABLE public.topic OWNER TO "z-blog";
--
-- Name: TABLE topic; Type: COMMENT; Schema: public; Owner: z-blog
--
COMMENT ON TABLE public.topic IS '标签';
--
-- Name: topic_id_seq; Type: SEQUENCE; Schema: public; Owner: z-blog
--
CREATE SEQUENCE public.topic_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.topic_id_seq OWNER TO "z-blog";
--
-- Name: topic_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: z-blog
--
ALTER SEQUENCE public.topic_id_seq OWNED BY public.topic.id;
--
-- Name: dashboard_user id; Type: DEFAULT; Schema: public; Owner: z-blog
--
ALTER TABLE ONLY public.dashboard_user ALTER COLUMN id SET DEFAULT nextval('public.dashboard_user_id_seq'::regclass);
--
-- Name: english id; Type: DEFAULT; Schema: public; Owner: z-blog
--
ALTER TABLE ONLY public.english ALTER COLUMN id SET DEFAULT nextval('public.english_id_seq'::regclass);
--
-- Name: ip_pool id; Type: DEFAULT; Schema: public; Owner: z-blog
--
ALTER TABLE ONLY public.ip_pool ALTER COLUMN id SET DEFAULT nextval('public.ip_pool_id_seq'::regclass);
--
-- Name: link id; Type: DEFAULT; Schema: public; Owner: z-blog
--
ALTER TABLE ONLY public.link ALTER COLUMN id SET DEFAULT nextval('public.link_id_seq'::regclass);
--
-- Name: message_board id; Type: DEFAULT; Schema: public; Owner: z-blog
--
ALTER TABLE ONLY public.message_board ALTER COLUMN id SET DEFAULT nextval('public.message_board_id_seq'::regclass);
--
-- Name: record_search id; Type: DEFAULT; Schema: public; Owner: z-blog
--
ALTER TABLE ONLY public.record_search ALTER COLUMN id SET DEFAULT nextval('public.record_search_id_seq'::regclass);
--
-- Name: topic id; Type: DEFAULT; Schema: public; Owner: z-blog
--
ALTER TABLE ONLY public.topic ALTER COLUMN id SET DEFAULT nextval('public.topic_id_seq'::regclass);
--
-- Name: message_board comment_pkey; Type: CONSTRAINT; Schema: public; Owner: z-blog
--
ALTER TABLE ONLY public.message_board
ADD CONSTRAINT comment_pkey PRIMARY KEY (id);
--
-- Name: english english_pkey; Type: CONSTRAINT; Schema: public; Owner: z-blog
--
ALTER TABLE ONLY public.english
ADD CONSTRAINT english_pkey PRIMARY KEY (id);
--
-- Name: ip_pool ip_pool_pkey; Type: CONSTRAINT; Schema: public; Owner: z-blog
--
ALTER TABLE ONLY public.ip_pool
ADD CONSTRAINT ip_pool_pkey PRIMARY KEY (id);
--
-- Name: ip_unknown ip_unknown_pkey; Type: CONSTRAINT; Schema: public; Owner: z-blog
--
ALTER TABLE ONLY public.ip_unknown
ADD CONSTRAINT ip_unknown_pkey PRIMARY KEY (ip);
--
-- Name: link link_pkey; Type: CONSTRAINT; Schema: public; Owner: z-blog
--
ALTER TABLE ONLY public.link
ADD CONSTRAINT link_pkey PRIMARY KEY (id);
--
-- Name: post post_pkey; Type: CONSTRAINT; Schema: public; Owner: z-blog
--
ALTER TABLE ONLY public.post
ADD CONSTRAINT post_pkey PRIMARY KEY (id);
--
-- Name: record_invalid_request record_invalid_request_pkey; Type: CONSTRAINT; Schema: public; Owner: z-blog
--
ALTER TABLE ONLY public.record_invalid_request
ADD CONSTRAINT record_invalid_request_pkey PRIMARY KEY (id);
--
-- Name: record_page_view record_page_view_pkey; Type: CONSTRAINT; Schema: public; Owner: z-blog
--
ALTER TABLE ONLY public.record_page_view
ADD CONSTRAINT record_page_view_pkey PRIMARY KEY (id);
--
-- Name: record_search record_search_pkey; Type: CONSTRAINT; Schema: public; Owner: z-blog
--
ALTER TABLE ONLY public.record_search
ADD CONSTRAINT record_search_pkey PRIMARY KEY (id);
--
-- Name: topic topic_pkey; Type: CONSTRAINT; Schema: public; Owner: z-blog
--
ALTER TABLE ONLY public.topic
ADD CONSTRAINT topic_pkey PRIMARY KEY (id);
--
-- Name: english unique; Type: CONSTRAINT; Schema: public; Owner: z-blog
--
ALTER TABLE ONLY public.english
ADD CONSTRAINT "unique" UNIQUE (word);
--
-- Name: topic unique_topic_name; Type: CONSTRAINT; Schema: public; Owner: z-blog
--
ALTER TABLE ONLY public.topic
ADD CONSTRAINT unique_topic_name UNIQUE (name);
--
-- Name: dashboard_user user_pkey; Type: CONSTRAINT; Schema: public; Owner: z-blog
--
ALTER TABLE ONLY public.dashboard_user
ADD CONSTRAINT user_pkey PRIMARY KEY (id);
--
-- Name: gin_index_topics; Type: INDEX; Schema: public; Owner: z-blog
--
CREATE INDEX gin_index_topics ON public.post USING gin (topics);