sneed
parent
2c4a14b70d
commit
aaf7c0f02e
94
schema.sql
94
schema.sql
|
@ -62,59 +62,6 @@ SET default_tablespace = '';
|
||||||
|
|
||||||
SET default_table_access_method = heap;
|
SET default_table_access_method = heap;
|
||||||
|
|
||||||
--
|
|
||||||
-- Name: submissions; Type: TABLE; Schema: public; Owner: -
|
|
||||||
--
|
|
||||||
|
|
||||||
CREATE TABLE public.submissions (
|
|
||||||
id integer NOT NULL,
|
|
||||||
author_id integer NOT NULL,
|
|
||||||
created_utc integer NOT NULL,
|
|
||||||
is_banned boolean DEFAULT false NOT NULL,
|
|
||||||
over_18 boolean DEFAULT false NOT NULL,
|
|
||||||
distinguish_level integer DEFAULT 0 NOT NULL,
|
|
||||||
deleted_utc integer DEFAULT 0 NOT NULL,
|
|
||||||
is_approved integer,
|
|
||||||
edited_utc integer DEFAULT 0 NOT NULL,
|
|
||||||
is_pinned boolean DEFAULT false NOT NULL,
|
|
||||||
upvotes integer DEFAULT 1 NOT NULL,
|
|
||||||
downvotes integer DEFAULT 0 NOT NULL,
|
|
||||||
app_id integer,
|
|
||||||
thumburl character varying(60),
|
|
||||||
private boolean DEFAULT false NOT NULL,
|
|
||||||
views integer DEFAULT 0 NOT NULL,
|
|
||||||
is_bot boolean DEFAULT false NOT NULL,
|
|
||||||
bannedfor boolean,
|
|
||||||
comment_count integer DEFAULT 0 NOT NULL,
|
|
||||||
club boolean DEFAULT false NOT NULL,
|
|
||||||
stickied character varying(40),
|
|
||||||
title character varying(500) NOT NULL,
|
|
||||||
url character varying(2083),
|
|
||||||
body character varying(20000),
|
|
||||||
body_html character varying(40000),
|
|
||||||
embed_url character varying(1500),
|
|
||||||
ban_reason character varying(25),
|
|
||||||
title_html character varying(1500) NOT NULL,
|
|
||||||
realupvotes integer,
|
|
||||||
flair character varying(350),
|
|
||||||
stickied_utc integer,
|
|
||||||
ghost boolean DEFAULT false NOT NULL,
|
|
||||||
sub character varying(20)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Name: comment_count_distinct(public.submissions); Type: FUNCTION; Schema: public; Owner: -
|
|
||||||
--
|
|
||||||
|
|
||||||
CREATE FUNCTION public.comment_count_distinct(public.submissions) RETURNS bigint
|
|
||||||
LANGUAGE sql IMMUTABLE STRICT
|
|
||||||
AS $_$
|
|
||||||
|
|
||||||
select count(distinct author_id) from comments where parent_submission=$1.id
|
|
||||||
$_$;
|
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Name: alts; Type: TABLE; Schema: public; Owner: -
|
-- Name: alts; Type: TABLE; Schema: public; Owner: -
|
||||||
--
|
--
|
||||||
|
@ -476,6 +423,47 @@ CREATE TABLE public.sub_blocks (
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: submissions; Type: TABLE; Schema: public; Owner: -
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE public.submissions (
|
||||||
|
id integer NOT NULL,
|
||||||
|
author_id integer NOT NULL,
|
||||||
|
created_utc integer NOT NULL,
|
||||||
|
is_banned boolean DEFAULT false NOT NULL,
|
||||||
|
over_18 boolean DEFAULT false NOT NULL,
|
||||||
|
distinguish_level integer DEFAULT 0 NOT NULL,
|
||||||
|
deleted_utc integer DEFAULT 0 NOT NULL,
|
||||||
|
is_approved integer,
|
||||||
|
edited_utc integer DEFAULT 0 NOT NULL,
|
||||||
|
is_pinned boolean DEFAULT false NOT NULL,
|
||||||
|
upvotes integer DEFAULT 1 NOT NULL,
|
||||||
|
downvotes integer DEFAULT 0 NOT NULL,
|
||||||
|
app_id integer,
|
||||||
|
thumburl character varying(60),
|
||||||
|
private boolean DEFAULT false NOT NULL,
|
||||||
|
views integer DEFAULT 0 NOT NULL,
|
||||||
|
is_bot boolean DEFAULT false NOT NULL,
|
||||||
|
bannedfor boolean,
|
||||||
|
comment_count integer DEFAULT 0 NOT NULL,
|
||||||
|
club boolean DEFAULT false NOT NULL,
|
||||||
|
stickied character varying(40),
|
||||||
|
title character varying(500) NOT NULL,
|
||||||
|
url character varying(2083),
|
||||||
|
body character varying(20000),
|
||||||
|
body_html character varying(40000),
|
||||||
|
embed_url character varying(1500),
|
||||||
|
ban_reason character varying(25),
|
||||||
|
title_html character varying(1500) NOT NULL,
|
||||||
|
realupvotes integer,
|
||||||
|
flair character varying(350),
|
||||||
|
stickied_utc integer,
|
||||||
|
ghost boolean DEFAULT false NOT NULL,
|
||||||
|
sub character varying(20)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Name: submissions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
-- Name: submissions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
||||||
--
|
--
|
||||||
|
|
Loading…
Reference in New Issue