schema
This commit is contained in:
parent
8e61d479b0
commit
c49956533b
2 changed files with 4 additions and 157 deletions
BIN
chart.png
Normal file
BIN
chart.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 52 KiB |
161
schema.sql
161
schema.sql
|
@ -360,43 +360,13 @@ CREATE TABLE public.comments (
|
|||
sentto integer,
|
||||
bannedfor boolean,
|
||||
removed_by integer,
|
||||
is_pinned text
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: comments_aux; Type: TABLE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE TABLE public.comments_aux (
|
||||
id integer,
|
||||
body character varying(10000),
|
||||
is_pinned text,
|
||||
body character varying(20000),
|
||||
body_html character varying(40000),
|
||||
ban_reason character varying(128),
|
||||
key_id integer NOT NULL
|
||||
ban_reason character varying(256)
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: comments_aux_key_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE SEQUENCE public.comments_aux_key_id_seq
|
||||
AS integer
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MINVALUE
|
||||
NO MAXVALUE
|
||||
CACHE 1;
|
||||
|
||||
|
||||
--
|
||||
-- Name: comments_aux_key_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER SEQUENCE public.comments_aux_key_id_seq OWNED BY public.comments_aux.key_id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -734,47 +704,17 @@ CREATE TABLE public.submissions (
|
|||
processing boolean DEFAULT false,
|
||||
removed_by integer,
|
||||
club boolean,
|
||||
stickied text
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: submissions_aux; Type: TABLE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE TABLE public.submissions_aux (
|
||||
id integer,
|
||||
stickied text,
|
||||
title character varying(500),
|
||||
url character varying(2083),
|
||||
body character varying(10000),
|
||||
body_html character varying(20000),
|
||||
embed_url character varying(10000),
|
||||
ban_reason character varying(128),
|
||||
key_id integer NOT NULL,
|
||||
title_html text
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: submissions_aux_key_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE SEQUENCE public.submissions_aux_key_id_seq
|
||||
AS integer
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MINVALUE
|
||||
NO MAXVALUE
|
||||
CACHE 1;
|
||||
|
||||
|
||||
--
|
||||
-- Name: submissions_aux_key_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER SEQUENCE public.submissions_aux_key_id_seq OWNED BY public.submissions_aux.key_id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: submissions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -1091,13 +1031,6 @@ ALTER TABLE ONLY public.commentflags ALTER COLUMN id SET DEFAULT nextval('public
|
|||
ALTER TABLE ONLY public.comments ALTER COLUMN id SET DEFAULT nextval('public.comments_id_seq'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: comments_aux key_id; Type: DEFAULT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public.comments_aux ALTER COLUMN key_id SET DEFAULT nextval('public.comments_aux_key_id_seq'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: commentvotes id; Type: DEFAULT; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -1161,13 +1094,6 @@ ALTER TABLE ONLY public.save_relationship ALTER COLUMN id SET DEFAULT nextval('p
|
|||
ALTER TABLE ONLY public.submissions ALTER COLUMN id SET DEFAULT nextval('public.submissions_id_seq'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: submissions_aux key_id; Type: DEFAULT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public.submissions_aux ALTER COLUMN key_id SET DEFAULT nextval('public.submissions_aux_key_id_seq'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: subscriptions id; Type: DEFAULT; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -1283,14 +1209,6 @@ ALTER TABLE ONLY public.commentflags
|
|||
ADD CONSTRAINT commentflags_pkey PRIMARY KEY (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: comments_aux comments_aux_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public.comments_aux
|
||||
ADD CONSTRAINT comments_aux_pkey PRIMARY KEY (key_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: comments comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -1427,14 +1345,6 @@ ALTER TABLE ONLY public.save_relationship
|
|||
ADD CONSTRAINT save_relationship_pkey PRIMARY KEY (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: submissions_aux submissions_aux_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public.submissions_aux
|
||||
ADD CONSTRAINT submissions_aux_pkey PRIMARY KEY (key_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: submissions submissions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -1644,20 +1554,6 @@ CREATE INDEX block_user_idx ON public.userblocks USING btree (user_id);
|
|||
CREATE INDEX cflag_user_idx ON public.commentflags USING btree (user_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: comment_body_idx; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX comment_body_idx ON public.comments_aux USING btree (body) WHERE (octet_length((body)::text) <= 2704);
|
||||
|
||||
|
||||
--
|
||||
-- Name: comment_body_trgm_idx; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX comment_body_trgm_idx ON public.comments_aux USING gin (body public.gin_trgm_ops);
|
||||
|
||||
|
||||
--
|
||||
-- Name: comment_parent_index; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -1679,13 +1575,6 @@ CREATE INDEX comment_post_id_index ON public.comments USING btree (parent_submis
|
|||
CREATE INDEX commentflag_comment_index ON public.commentflags USING btree (comment_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: comments_aux_id_idx; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX comments_aux_id_idx ON public.comments_aux USING btree (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: comments_parent_id_idx; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -1700,13 +1589,6 @@ CREATE INDEX comments_parent_id_idx ON public.comments USING btree (parent_comme
|
|||
CREATE INDEX comments_user_index ON public.comments USING btree (author_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: commentsaux_body_idx; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX commentsaux_body_idx ON public.comments_aux USING gin (to_tsvector('english'::regconfig, (body)::text));
|
||||
|
||||
|
||||
--
|
||||
-- Name: commentvotes_comments_id_index; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -1868,20 +1750,6 @@ CREATE INDEX sub_user_index ON public.subscriptions USING btree (user_id);
|
|||
CREATE INDEX subimssion_binary_group_idx ON public.submissions USING btree (is_banned, deleted_utc, over_18);
|
||||
|
||||
|
||||
--
|
||||
-- Name: submission_aux_url_idx; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX submission_aux_url_idx ON public.submissions_aux USING btree (url);
|
||||
|
||||
|
||||
--
|
||||
-- Name: submission_aux_url_trgm_idx; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX submission_aux_url_trgm_idx ON public.submissions_aux USING gin (url public.gin_trgm_ops);
|
||||
|
||||
|
||||
--
|
||||
-- Name: submission_domainref_index; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -1924,20 +1792,6 @@ CREATE INDEX submission_pinned_idx ON public.submissions USING btree (is_pinned)
|
|||
CREATE INDEX submissions_author_index ON public.submissions USING btree (author_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: submissions_aux_id_idx; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX submissions_aux_id_idx ON public.submissions_aux USING btree (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: submissions_aux_title_idx; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX submissions_aux_title_idx ON public.submissions_aux USING btree (title);
|
||||
|
||||
|
||||
--
|
||||
-- Name: submissions_created_utc_desc_idx; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -1952,13 +1806,6 @@ CREATE INDEX submissions_created_utc_desc_idx ON public.submissions USING btree
|
|||
CREATE INDEX submissions_over18_index ON public.submissions USING btree (over_18);
|
||||
|
||||
|
||||
--
|
||||
-- Name: submissions_title_trgm_idx; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE INDEX submissions_title_trgm_idx ON public.submissions_aux USING gin (title public.gin_trgm_ops);
|
||||
|
||||
|
||||
--
|
||||
-- Name: subscription_board_index; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue