MarseyWorld/schema.sql

1883 lines
40 KiB
MySQL
Raw Normal View History

2021-10-20 14:37:15 +00:00
--
-- PostgreSQL database dump
--
2021-12-20 20:06:13 +00:00
-- Dumped from database version 13.5
2022-01-19 09:19:22 +00:00
-- Dumped by pg_dump version 14.1 (Ubuntu 14.1-2.pgdg20.04+1)
2021-10-20 14:37:15 +00:00
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;
--
-- Name: fuzzystrmatch; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch WITH SCHEMA public;
--
-- Name: EXTENSION fuzzystrmatch; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION fuzzystrmatch IS 'determine similarities and distance between strings';
--
-- Name: pg_stat_statements; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS pg_stat_statements WITH SCHEMA public;
--
-- Name: EXTENSION pg_stat_statements; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION pg_stat_statements IS 'track planning and execution statistics of all SQL statements executed';
--
-- Name: pg_trgm; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public;
--
-- Name: EXTENSION pg_trgm; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION pg_trgm IS 'text similarity measurement and index searching based on trigrams';
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: alts; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.alts (
2021-10-23 17:02:50 +00:00
id integer NOT NULL,
user1 integer NOT NULL,
user2 integer NOT NULL,
2022-01-29 02:00:01 +00:00
is_manual boolean DEFAULT false,
CONSTRAINT alts_cant_be_equal CHECK ((user1 <> user2))
2021-10-20 14:37:15 +00:00
);
--
-- Name: alts_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.alts_id_seq
2021-10-23 17:02:50 +00:00
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
2021-10-20 14:37:15 +00:00
--
-- Name: alts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.alts_id_seq OWNED BY public.alts.id;
--
-- Name: award_relationships; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.award_relationships (
2021-10-23 17:02:50 +00:00
id integer NOT NULL,
user_id integer,
submission_id integer,
comment_id integer,
kind character varying(20)
2021-10-20 14:37:15 +00:00
);
--
-- Name: award_relationships_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.award_relationships_id_seq
2021-10-23 17:02:50 +00:00
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
2021-10-20 14:37:15 +00:00
--
-- Name: award_relationships_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.award_relationships_id_seq OWNED BY public.award_relationships.id;
2022-01-24 01:08:51 +00:00
--
-- Name: badge_defs; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.badge_defs (
id integer NOT NULL,
name character varying(50) NOT NULL,
description character varying(200)
);
--
-- Name: badge_defs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.badge_defs_id_seq
AS integer
START WITH 106
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: badge_defs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.badge_defs_id_seq OWNED BY public.badge_defs.id;
2021-10-20 14:37:15 +00:00
--
-- Name: badges; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.badges (
2021-10-23 17:02:50 +00:00
id integer NOT NULL,
badge_id integer,
user_id integer,
description character varying(256),
url character varying(256)
2021-10-20 14:37:15 +00:00
);
--
-- Name: badges_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.badges_id_seq
2021-10-23 17:02:50 +00:00
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
2021-10-20 14:37:15 +00:00
--
-- Name: badges_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.badges_id_seq OWNED BY public.badges.id;
--
-- Name: banneddomains; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.banneddomains (
2021-10-23 17:02:50 +00:00
id integer NOT NULL,
domain character varying(100),
reason character varying(100)
2021-10-20 14:37:15 +00:00
);
--
-- Name: client_auths; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.client_auths (
2021-10-23 17:02:50 +00:00
id integer NOT NULL,
user_id integer,
oauth_client integer,
access_token character(128)
2021-10-20 14:37:15 +00:00
);
--
-- Name: client_auths_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.client_auths_id_seq
2021-10-23 17:02:50 +00:00
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
2021-10-20 14:37:15 +00:00
--
-- Name: client_auths_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.client_auths_id_seq OWNED BY public.client_auths.id;
--
-- Name: commentflags; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.commentflags (
2021-10-23 17:02:50 +00:00
id integer NOT NULL,
user_id integer,
comment_id integer,
reason character varying(350)
2021-10-20 14:37:15 +00:00
);
--
-- Name: commentflags_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.commentflags_id_seq
2021-10-23 17:02:50 +00:00
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
2021-10-20 14:37:15 +00:00
--
-- Name: commentflags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.commentflags_id_seq OWNED BY public.commentflags.id;
--
-- Name: comments; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.comments (
2021-10-23 17:02:50 +00:00
id integer NOT NULL,
author_id integer,
created_utc integer NOT NULL,
parent_submission integer,
is_banned boolean,
distinguish_level integer,
edited_utc integer,
deleted_utc integer NOT NULL,
is_approved integer NOT NULL,
author_name character varying(64),
approved_utc integer,
level integer,
parent_comment_id integer,
over_18 boolean,
upvotes integer,
downvotes integer,
is_bot boolean DEFAULT false,
app_id integer,
sentto integer,
bannedfor boolean,
2021-12-28 08:07:07 +00:00
is_pinned character varying(40),
2021-10-23 17:02:50 +00:00
body character varying(10000),
body_html character varying(40000),
2021-11-05 14:40:14 +00:00
ban_reason character varying(25),
2021-12-05 02:24:35 +00:00
realupvotes integer,
2021-12-26 00:27:20 +00:00
top_comment_id integer,
2022-01-22 10:15:53 +00:00
is_pinned_utc integer,
2022-01-24 01:08:51 +00:00
ghost boolean,
slots_result character varying(50),
blackjack_result character varying(3000),
treasure_amount character varying(10)
2021-10-20 14:37:15 +00:00
);
--
-- Name: comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.comments_id_seq
2021-10-23 17:02:50 +00:00
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
2021-10-20 14:37:15 +00:00
--
-- Name: comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.comments_id_seq OWNED BY public.comments.id;
--
-- Name: commentvotes; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.commentvotes (
2021-10-23 17:02:50 +00:00
id integer NOT NULL,
comment_id integer,
vote_type integer,
user_id integer,
creation_ip character(64),
2021-11-30 16:50:44 +00:00
app_id integer,
"real" boolean
2021-10-20 14:37:15 +00:00
);
--
-- Name: commentvotes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.commentvotes_id_seq
2021-10-23 17:02:50 +00:00
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
2021-10-20 14:37:15 +00:00
--
-- Name: commentvotes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.commentvotes_id_seq OWNED BY public.commentvotes.id;
--
-- Name: domains_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.domains_id_seq
2021-10-23 17:02:50 +00:00
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
2021-10-20 14:37:15 +00:00
--
-- Name: domains_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.domains_id_seq OWNED BY public.banneddomains.id;
--
-- Name: flags; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.flags (
2021-10-23 17:02:50 +00:00
id integer NOT NULL,
user_id integer,
post_id integer,
reason character varying(350)
2021-10-20 14:37:15 +00:00
);
--
-- Name: flags_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.flags_id_seq
2021-10-23 17:02:50 +00:00
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
2021-10-20 14:37:15 +00:00
--
-- Name: flags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.flags_id_seq OWNED BY public.flags.id;
--
-- Name: follows; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.follows (
2021-10-23 17:02:50 +00:00
id integer NOT NULL,
user_id integer,
target_id integer
2021-10-20 14:37:15 +00:00
);
--
-- Name: follows_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.follows_id_seq
2021-10-23 17:02:50 +00:00
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
2021-10-20 14:37:15 +00:00
--
-- Name: follows_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.follows_id_seq OWNED BY public.follows.id;
2022-01-24 01:08:51 +00:00
--
-- Name: marseys; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.marseys (
name character varying(30) NOT NULL,
author_id integer NOT NULL,
tags character varying(200) NOT NULL,
count integer DEFAULT 0 NOT NULL
);
2021-10-20 14:37:15 +00:00
--
-- Name: modactions; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.modactions (
2021-10-23 17:02:50 +00:00
id integer NOT NULL,
user_id integer,
target_user_id integer,
target_submission_id integer,
target_comment_id integer,
created_utc integer DEFAULT 0,
kind character varying(32) DEFAULT NULL::character varying,
2021-11-09 05:52:05 +00:00
_note character varying(256) DEFAULT NULL::character varying
2021-10-20 14:37:15 +00:00
);
--
-- Name: modactions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.modactions_id_seq
2021-10-23 17:02:50 +00:00
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
2021-10-20 14:37:15 +00:00
--
-- Name: modactions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.modactions_id_seq OWNED BY public.modactions.id;
2022-02-05 22:00:02 +00:00
--
-- Name: mods; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.mods (
user_id integer NOT NULL,
sub character varying(20) NOT NULL
);
2021-10-20 14:37:15 +00:00
--
-- Name: notifications; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.notifications (
2021-10-23 17:02:50 +00:00
id integer NOT NULL,
user_id integer,
comment_id integer,
2021-12-20 20:06:13 +00:00
read boolean NOT NULL
2021-10-20 14:37:15 +00:00
);
--
-- Name: notifications_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.notifications_id_seq
2021-10-23 17:02:50 +00:00
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
2021-10-20 14:37:15 +00:00
--
-- Name: notifications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.notifications_id_seq OWNED BY public.notifications.id;
--
-- Name: oauth_apps; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.oauth_apps (
2021-10-23 17:02:50 +00:00
id integer NOT NULL,
client_id character(64),
app_name character varying(50),
redirect_uri character varying(4096),
author_id integer,
description character varying(256)
2021-10-20 14:37:15 +00:00
);
--
-- Name: oauth_apps_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.oauth_apps_id_seq
2021-10-23 17:02:50 +00:00
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
2021-10-20 14:37:15 +00:00
--
-- Name: oauth_apps_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.oauth_apps_id_seq OWNED BY public.oauth_apps.id;
--
-- Name: save_relationship; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.save_relationship (
2021-10-23 17:02:50 +00:00
id integer NOT NULL,
submission_id integer,
user_id integer,
comment_id integer
2021-10-20 14:37:15 +00:00
);
--
-- Name: save_relationship_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.save_relationship_id_seq
2021-10-23 17:02:50 +00:00
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
2021-10-20 14:37:15 +00:00
--
-- Name: save_relationship_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.save_relationship_id_seq OWNED BY public.save_relationship.id;
--
-- Name: submissions; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.submissions (
2021-10-23 17:02:50 +00:00
id integer NOT NULL,
author_id integer,
created_utc integer NOT NULL,
is_banned boolean,
over_18 boolean,
distinguish_level integer,
deleted_utc integer NOT NULL,
domain_ref integer,
is_approved integer NOT NULL,
edited_utc integer,
is_pinned boolean,
upvotes integer,
downvotes integer,
app_id integer,
thumburl character varying(60),
private boolean,
views integer,
is_bot boolean,
bannedfor boolean,
comment_count integer DEFAULT 0,
club boolean,
2021-12-28 08:07:07 +00:00
stickied character varying(40),
2021-10-23 17:02:50 +00:00
title character varying(500),
url character varying(2083),
2022-01-19 09:19:22 +00:00
body character varying(20000),
body_html character varying(40000),
2021-11-04 16:58:07 +00:00
embed_url character varying(1500),
2021-11-05 14:40:14 +00:00
ban_reason character varying(25),
2021-11-30 16:50:44 +00:00
title_html character varying(1500),
2021-12-05 20:18:23 +00:00
realupvotes integer,
2021-12-26 00:27:20 +00:00
flair character varying(350),
2022-01-22 10:15:53 +00:00
stickied_utc integer,
2022-02-04 15:00:02 +00:00
ghost boolean,
2022-02-04 18:35:39 +00:00
sub character varying(20)
2021-10-20 14:37:15 +00:00
);
--
-- Name: submissions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.submissions_id_seq
2021-10-23 17:02:50 +00:00
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
2021-10-20 14:37:15 +00:00
--
-- Name: submissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.submissions_id_seq OWNED BY public.submissions.id;
2022-02-05 22:00:02 +00:00
--
-- Name: subs; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.subs (
name character varying(20) NOT NULL,
sidebar character varying(500),
sidebar_html character varying(1000)
);
2021-10-20 14:37:15 +00:00
--
-- Name: subscriptions; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.subscriptions (
2021-10-23 17:02:50 +00:00
id integer NOT NULL,
user_id integer,
board_id integer,
submission_id integer
2021-10-20 14:37:15 +00:00
);
--
-- Name: subscriptions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.subscriptions_id_seq
2021-10-23 17:02:50 +00:00
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
2021-10-20 14:37:15 +00:00
--
-- Name: subscriptions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.subscriptions_id_seq OWNED BY public.subscriptions.id;
--
-- Name: userblocks; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.userblocks (
2021-10-23 17:02:50 +00:00
id integer NOT NULL,
user_id integer,
target_id integer
2021-10-20 14:37:15 +00:00
);
--
-- Name: userblocks_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.userblocks_id_seq
2021-10-23 17:02:50 +00:00
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
2021-10-20 14:37:15 +00:00
--
-- Name: userblocks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.userblocks_id_seq OWNED BY public.userblocks.id;
--
-- Name: users; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.users (
2021-10-23 17:02:50 +00:00
id integer NOT NULL,
username character varying(255) NOT NULL,
email character varying(255),
passhash character varying(255) NOT NULL,
created_utc integer NOT NULL,
admin_level integer,
over_18 boolean,
is_activated boolean,
bio character varying(1500),
bio_html character varying(10000),
referred_by integer,
is_banned integer,
2021-11-05 14:36:23 +00:00
ban_reason character varying(256),
2021-10-23 17:02:50 +00:00
login_nonce integer,
reserved character varying(256),
mfa_secret character varying(32),
is_private boolean,
unban_utc integer,
is_nofollow boolean DEFAULT false,
custom_filter_list character varying(1000) DEFAULT ''::character varying,
discord_id character varying(64),
stored_subscriber_count integer DEFAULT 0,
ban_evade integer DEFAULT 0,
original_username character varying(255),
customtitle character varying(1000),
defaultsorting character varying(15),
defaulttime character varying(5),
namecolor character varying(6),
titlecolor character varying(6),
profileurl character varying(65),
bannerurl character varying(65),
hidevotedon boolean,
newtab boolean,
flairchanged integer,
defaultsortingcomments character varying(15),
theme character varying(15),
song character varying(50),
slurreplacer boolean,
shadowbanned character varying(25),
newtabexternal boolean,
customtitleplain character varying(100),
themecolor character varying(6),
changelogsub boolean,
oldreddit boolean,
css character varying(4000),
profilecss character varying(4000),
coins integer,
agendaposter boolean,
agendaposter_expires_utc integer DEFAULT 0,
suicide_utc integer,
post_count integer,
comment_count integer,
highres character varying(60),
rent_utc integer,
patron integer,
controversial boolean,
background character varying(20),
verified character varying(20),
fail_utc integer,
steal_utc integer,
fail2_utc integer,
cardview boolean,
received_award_count integer,
highlightcomments boolean,
nitter boolean,
truecoins integer,
club_allowed boolean DEFAULT false,
frontsize integer,
coins_spent integer,
procoins integer,
mute boolean,
2021-10-27 20:11:54 +00:00
unmutable boolean,
verifiedcolor character varying(6),
2021-11-04 16:19:28 +00:00
marseyawarded integer,
sig character varying(200),
sig_html character varying(1000),
friends character varying(500),
2021-11-09 05:52:05 +00:00
friends_html character varying(2000),
sigs_disabled boolean,
2021-11-06 15:21:05 +00:00
enemies character varying(500),
2021-11-19 20:45:53 +00:00
enemies_html character varying(2000),
fp character varying(21),
eye boolean,
alt boolean,
longpost integer,
2021-11-20 09:07:32 +00:00
unblockable boolean,
2021-11-25 21:31:01 +00:00
teddit boolean,
2021-12-10 17:32:39 +00:00
bird integer,
2021-12-12 17:47:03 +00:00
fish boolean,
2021-12-20 20:06:13 +00:00
lootboxes_bought integer,
2022-01-25 18:20:21 +00:00
progressivestack integer,
2022-01-29 03:00:02 +00:00
winnings integer,
2022-01-31 02:00:01 +00:00
patron_utc integer,
2022-02-01 05:00:02 +00:00
rehab integer,
2022-02-04 12:00:01 +00:00
nwordpass boolean,
2022-02-10 19:00:02 +00:00
house character varying(8),
subs_created integer DEFAULT 0
2021-10-20 14:37:15 +00:00
);
--
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.users_id_seq
2021-10-23 17:02:50 +00:00
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
2021-10-20 14:37:15 +00:00
--
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
--
-- Name: viewers; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.viewers (
2021-10-23 17:02:50 +00:00
id integer NOT NULL,
user_id integer,
viewer_id integer,
last_view_utc integer
2021-10-20 14:37:15 +00:00
);
--
-- Name: viewers_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.viewers_id_seq
2021-10-23 17:02:50 +00:00
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
2021-10-20 14:37:15 +00:00
--
-- Name: viewers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.viewers_id_seq OWNED BY public.viewers.id;
--
-- Name: votes; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.votes (
2021-10-23 17:02:50 +00:00
id integer NOT NULL,
user_id integer NOT NULL,
submission_id integer,
vote_type integer,
creation_ip character(64),
2021-11-30 16:50:44 +00:00
app_id integer,
"real" boolean
2021-10-20 14:37:15 +00:00
);
--
-- Name: votes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.votes_id_seq
2021-10-23 17:02:50 +00:00
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
2021-10-20 14:37:15 +00:00
--
-- Name: votes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.votes_id_seq OWNED BY public.votes.id;
--
-- Name: alts id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.alts ALTER COLUMN id SET DEFAULT nextval('public.alts_id_seq'::regclass);
--
-- Name: award_relationships id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.award_relationships ALTER COLUMN id SET DEFAULT nextval('public.award_relationships_id_seq'::regclass);
2022-01-24 01:08:51 +00:00
--
-- Name: badge_defs id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.badge_defs ALTER COLUMN id SET DEFAULT nextval('public.badge_defs_id_seq'::regclass);
2021-10-20 14:37:15 +00:00
--
-- Name: badges id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.badges ALTER COLUMN id SET DEFAULT nextval('public.badges_id_seq'::regclass);
--
-- Name: banneddomains id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.banneddomains ALTER COLUMN id SET DEFAULT nextval('public.domains_id_seq'::regclass);
--
-- Name: client_auths id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.client_auths ALTER COLUMN id SET DEFAULT nextval('public.client_auths_id_seq'::regclass);
--
-- Name: commentflags id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.commentflags ALTER COLUMN id SET DEFAULT nextval('public.commentflags_id_seq'::regclass);
--
-- Name: comments id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.comments ALTER COLUMN id SET DEFAULT nextval('public.comments_id_seq'::regclass);
--
-- Name: commentvotes id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.commentvotes ALTER COLUMN id SET DEFAULT nextval('public.commentvotes_id_seq'::regclass);
--
-- Name: flags id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.flags ALTER COLUMN id SET DEFAULT nextval('public.flags_id_seq'::regclass);
--
-- Name: follows id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.follows ALTER COLUMN id SET DEFAULT nextval('public.follows_id_seq'::regclass);
--
-- Name: modactions id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.modactions ALTER COLUMN id SET DEFAULT nextval('public.modactions_id_seq'::regclass);
--
-- Name: notifications id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.notifications ALTER COLUMN id SET DEFAULT nextval('public.notifications_id_seq'::regclass);
--
-- Name: oauth_apps id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.oauth_apps ALTER COLUMN id SET DEFAULT nextval('public.oauth_apps_id_seq'::regclass);
--
-- Name: save_relationship id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.save_relationship ALTER COLUMN id SET DEFAULT nextval('public.save_relationship_id_seq'::regclass);
--
-- Name: submissions id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.submissions ALTER COLUMN id SET DEFAULT nextval('public.submissions_id_seq'::regclass);
--
-- Name: subscriptions id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subscriptions ALTER COLUMN id SET DEFAULT nextval('public.subscriptions_id_seq'::regclass);
--
-- Name: userblocks id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.userblocks ALTER COLUMN id SET DEFAULT nextval('public.userblocks_id_seq'::regclass);
--
-- Name: users id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);
--
-- Name: viewers id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.viewers ALTER COLUMN id SET DEFAULT nextval('public.viewers_id_seq'::regclass);
--
-- Name: votes id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.votes ALTER COLUMN id SET DEFAULT nextval('public.votes_id_seq'::regclass);
--
-- Name: alts alts_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.alts
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT alts_pkey PRIMARY KEY (user1, user2);
2021-10-20 14:37:15 +00:00
--
-- Name: award_relationships award_constraint; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.award_relationships
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT award_constraint UNIQUE (user_id, submission_id, comment_id);
2021-10-20 14:37:15 +00:00
--
-- Name: award_relationships award_relationships_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.award_relationships
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT award_relationships_pkey PRIMARY KEY (id);
2021-10-20 14:37:15 +00:00
2022-01-24 01:08:51 +00:00
--
-- Name: badge_defs badge_defs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.badge_defs
ADD CONSTRAINT badge_defs_pkey PRIMARY KEY (id);
2021-10-20 14:37:15 +00:00
--
-- Name: badges badges_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.badges
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT badges_pkey PRIMARY KEY (id);
2021-10-20 14:37:15 +00:00
--
-- Name: client_auths client_auths_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.client_auths
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT client_auths_pkey PRIMARY KEY (id);
2021-10-20 14:37:15 +00:00
--
-- Name: commentflags commentflags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.commentflags
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT commentflags_pkey PRIMARY KEY (id);
2021-10-20 14:37:15 +00:00
--
-- Name: comments comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.comments
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT comments_pkey PRIMARY KEY (id);
2021-10-20 14:37:15 +00:00
--
-- Name: commentvotes commentvotes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.commentvotes
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT commentvotes_pkey PRIMARY KEY (id);
2021-10-20 14:37:15 +00:00
--
-- Name: banneddomains domains_domain_key; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.banneddomains
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT domains_domain_key UNIQUE (domain);
2021-10-20 14:37:15 +00:00
--
-- Name: banneddomains domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.banneddomains
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT domains_pkey PRIMARY KEY (id);
2021-10-20 14:37:15 +00:00
--
-- Name: flags flags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.flags
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT flags_pkey PRIMARY KEY (id);
2021-10-20 14:37:15 +00:00
--
-- Name: follows follow_membership_unique; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.follows
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT follow_membership_unique UNIQUE (user_id, target_id);
2021-10-20 14:37:15 +00:00
--
-- Name: follows follows_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.follows
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT follows_pkey PRIMARY KEY (id);
2021-10-20 14:37:15 +00:00
2022-01-24 01:08:51 +00:00
--
-- Name: marseys marseys_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.marseys
ADD CONSTRAINT marseys_pkey PRIMARY KEY (name);
2021-10-20 14:37:15 +00:00
--
-- Name: modactions modactions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.modactions
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT modactions_pkey PRIMARY KEY (id);
2021-10-20 14:37:15 +00:00
2022-02-05 22:00:02 +00:00
--
-- Name: mods mods_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.mods
ADD CONSTRAINT mods_pkey PRIMARY KEY (user_id, sub);
2021-10-20 14:37:15 +00:00
--
-- Name: notifications notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.notifications
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT notifications_pkey PRIMARY KEY (id);
2021-10-20 14:37:15 +00:00
--
-- Name: oauth_apps oauth_apps_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.oauth_apps
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT oauth_apps_pkey PRIMARY KEY (id);
2021-10-20 14:37:15 +00:00
--
-- Name: users one_discord_account; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.users
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT one_discord_account UNIQUE (discord_id);
2021-10-20 14:37:15 +00:00
--
-- Name: notifications one_notif; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.notifications
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT one_notif UNIQUE (user_id, comment_id);
2021-10-20 14:37:15 +00:00
--
-- Name: commentvotes onecvote; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.commentvotes
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT onecvote UNIQUE (user_id, comment_id);
2021-10-20 14:37:15 +00:00
--
-- Name: votes onevote; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.votes
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT onevote UNIQUE (user_id, submission_id);
2021-10-20 14:37:15 +00:00
--
-- Name: save_relationship save_constraint; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.save_relationship
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT save_constraint UNIQUE (submission_id, user_id);
2021-10-20 14:37:15 +00:00
--
-- Name: save_relationship save_relationship_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.save_relationship
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT save_relationship_pkey PRIMARY KEY (id);
2021-10-20 14:37:15 +00:00
--
-- Name: submissions submissions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.submissions
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT submissions_pkey PRIMARY KEY (id);
2021-10-20 14:37:15 +00:00
2022-02-05 22:00:02 +00:00
--
-- Name: subs subs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subs
ADD CONSTRAINT subs_pkey PRIMARY KEY (name);
2021-10-20 14:37:15 +00:00
--
-- Name: subscriptions subscriptions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subscriptions
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT subscriptions_pkey PRIMARY KEY (id);
2021-10-20 14:37:15 +00:00
--
-- Name: client_auths unique_access; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.client_auths
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT unique_access UNIQUE (access_token);
2021-10-20 14:37:15 +00:00
2022-01-24 01:08:51 +00:00
--
-- Name: badge_defs unique_badge_name; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.badge_defs
ADD CONSTRAINT unique_badge_name UNIQUE (name);
2021-10-20 14:37:15 +00:00
--
-- Name: oauth_apps unique_id; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.oauth_apps
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT unique_id UNIQUE (client_id);
2021-10-20 14:37:15 +00:00
--
-- Name: badges user_badge_constraint; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.badges
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT user_badge_constraint UNIQUE (user_id, badge_id);
2021-10-20 14:37:15 +00:00
--
-- Name: userblocks userblocks_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.userblocks
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT userblocks_pkey PRIMARY KEY (id);
2021-10-20 14:37:15 +00:00
--
-- Name: alts userpair; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.alts
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT userpair UNIQUE (user1, user2);
2021-10-20 14:37:15 +00:00
--
-- Name: users users_original_username_key; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.users
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT users_original_username_key UNIQUE (original_username);
2021-10-20 14:37:15 +00:00
--
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.users
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT users_pkey PRIMARY KEY (username);
2021-10-20 14:37:15 +00:00
--
-- Name: users users_username_key; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.users
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT users_username_key UNIQUE (username);
2021-10-20 14:37:15 +00:00
--
-- Name: viewers viewers_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.viewers
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT viewers_pkey PRIMARY KEY (id);
2021-10-20 14:37:15 +00:00
--
-- Name: votes votes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.votes
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT votes_pkey PRIMARY KEY (id);
2021-10-20 14:37:15 +00:00
2022-01-29 03:00:02 +00:00
--
-- Name: alts_unique_combination; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX alts_unique_combination ON public.alts USING btree (GREATEST(user1, user2), LEAST(user1, user2));
2021-10-20 14:37:15 +00:00
--
-- Name: alts_user1_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX alts_user1_idx ON public.alts USING btree (user1);
--
-- Name: alts_user2_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX alts_user2_idx ON public.alts USING btree (user2);
--
-- Name: award_comment_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX award_comment_idx ON public.award_relationships USING btree (comment_id);
--
-- Name: award_post_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX award_post_idx ON public.award_relationships USING btree (submission_id);
--
-- Name: award_user_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX award_user_idx ON public.award_relationships USING btree (user_id);
--
-- Name: badges_badge_id_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX badges_badge_id_idx ON public.badges USING btree (badge_id);
--
-- Name: badges_user_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX badges_user_index ON public.badges USING btree (user_id);
--
-- Name: block_target_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX block_target_idx ON public.userblocks USING btree (target_id);
--
-- Name: block_user_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX block_user_idx ON public.userblocks USING btree (user_id);
--
-- Name: cflag_user_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX cflag_user_idx ON public.commentflags USING btree (user_id);
--
-- Name: comment_parent_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX comment_parent_index ON public.comments USING btree (parent_comment_id);
--
-- Name: comment_post_id_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX comment_post_id_index ON public.comments USING btree (parent_submission);
--
-- Name: commentflag_comment_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX commentflag_comment_index ON public.commentflags USING btree (comment_id);
--
-- Name: comments_parent_id_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX comments_parent_id_idx ON public.comments USING btree (parent_comment_id);
--
-- Name: comments_user_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX comments_user_index ON public.comments USING btree (author_id);
--
-- Name: commentvotes_comments_id_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX commentvotes_comments_id_index ON public.commentvotes USING btree (comment_id);
--
-- Name: commentvotes_comments_type_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX commentvotes_comments_type_index ON public.commentvotes USING btree (vote_type);
--
-- Name: cvote_user_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX cvote_user_index ON public.commentvotes USING btree (user_id);
--
-- Name: discord_id_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX discord_id_idx ON public.users USING btree (discord_id);
--
-- Name: domain_ref_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX domain_ref_idx ON public.submissions USING btree (domain_ref);
--
-- Name: domains_domain_trgm_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX domains_domain_trgm_idx ON public.banneddomains USING gin (domain public.gin_trgm_ops);
--
-- Name: flag_user_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX flag_user_idx ON public.flags USING btree (user_id);
--
-- Name: flags_post_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX flags_post_index ON public.flags USING btree (post_id);
--
-- Name: follow_target_id_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX follow_target_id_index ON public.follows USING btree (target_id);
--
-- Name: follow_user_id_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX follow_user_id_index ON public.follows USING btree (user_id);
2022-01-24 01:08:51 +00:00
--
-- Name: marseys_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX marseys_idx ON public.marseys USING btree (name);
--
-- Name: marseys_idx2; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX marseys_idx2 ON public.marseys USING btree (author_id);
--
-- Name: marseys_idx3; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX marseys_idx3 ON public.marseys USING btree (count DESC);
2021-10-20 14:37:15 +00:00
--
-- Name: modaction_action_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX modaction_action_idx ON public.modactions USING btree (kind);
--
-- Name: modaction_cid_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX modaction_cid_idx ON public.modactions USING btree (target_comment_id);
--
-- Name: modaction_id_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX modaction_id_idx ON public.modactions USING btree (id DESC);
--
-- Name: modaction_pid_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX modaction_pid_idx ON public.modactions USING btree (target_submission_id);
2022-02-05 22:00:02 +00:00
--
-- Name: mods_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX mods_idx ON public.mods USING btree (user_id);
2021-10-20 14:37:15 +00:00
--
-- Name: notification_read_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX notification_read_idx ON public.notifications USING btree (read);
--
-- Name: notifications_comment_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX notifications_comment_idx ON public.notifications USING btree (comment_id);
--
-- Name: notifications_user_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX notifications_user_index ON public.notifications USING btree (user_id);
--
-- Name: notifs_user_read_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX notifs_user_read_idx ON public.notifications USING btree (user_id, read);
--
-- Name: post_18_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX post_18_index ON public.submissions USING btree (over_18);
--
-- Name: post_app_id_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX post_app_id_idx ON public.submissions USING btree (app_id);
--
-- Name: post_author_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX post_author_index ON public.submissions USING btree (author_id);
--
-- Name: sub_user_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX sub_user_index ON public.subscriptions USING btree (user_id);
--
-- Name: subimssion_binary_group_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX subimssion_binary_group_idx ON public.submissions USING btree (is_banned, deleted_utc, over_18);
--
-- Name: submission_domainref_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX submission_domainref_index ON public.submissions USING btree (domain_ref);
--
-- Name: submission_isbanned_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX submission_isbanned_idx ON public.submissions USING btree (is_banned);
--
-- Name: submission_isdeleted_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX submission_isdeleted_idx ON public.submissions USING btree (deleted_utc);
--
-- Name: submission_new_sort_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX submission_new_sort_idx ON public.submissions USING btree (is_banned, deleted_utc, created_utc DESC, over_18);
--
-- Name: submission_pinned_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX submission_pinned_idx ON public.submissions USING btree (is_pinned);
--
-- Name: submissions_author_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX submissions_author_index ON public.submissions USING btree (author_id);
--
-- Name: submissions_created_utc_desc_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX submissions_created_utc_desc_idx ON public.submissions USING btree (created_utc DESC);
--
-- Name: submissions_over18_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX submissions_over18_index ON public.submissions USING btree (over_18);
2022-02-05 22:00:02 +00:00
--
-- Name: subs_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX subs_idx ON public.subs USING btree (name);
2021-10-20 14:37:15 +00:00
--
-- Name: subscription_board_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX subscription_board_index ON public.subscriptions USING btree (board_id);
--
-- Name: subscription_user_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX subscription_user_index ON public.subscriptions USING btree (user_id);
--
-- Name: user_banned_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX user_banned_idx ON public.users USING btree (is_banned);
--
-- Name: user_privacy_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX user_privacy_idx ON public.users USING btree (is_private);
--
-- Name: user_private_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX user_private_idx ON public.users USING btree (is_private);
--
-- Name: userblocks_both_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX userblocks_both_idx ON public.userblocks USING btree (user_id, target_id);
--
-- Name: users_created_utc_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX users_created_utc_index ON public.users USING btree (created_utc);
--
-- Name: users_original_username_trgm_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX users_original_username_trgm_idx ON public.users USING gin (original_username public.gin_trgm_ops);
--
-- Name: users_subs_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX users_subs_idx ON public.users USING btree (stored_subscriber_count);
--
-- Name: users_unbanutc_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX users_unbanutc_idx ON public.users USING btree (unban_utc DESC);
--
-- Name: users_username_trgm_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX users_username_trgm_idx ON public.users USING gin (username public.gin_trgm_ops);
--
-- Name: vote_user_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX vote_user_index ON public.votes USING btree (user_id);
--
-- Name: votes_submission_id_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX votes_submission_id_index ON public.votes USING btree (submission_id);
--
-- Name: votes_type_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX votes_type_index ON public.votes USING btree (vote_type);
2022-01-24 01:08:51 +00:00
--
-- Name: badges badges_badge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.badges
ADD CONSTRAINT badges_badge_id_fkey FOREIGN KEY (badge_id) REFERENCES public.badge_defs(id);
2021-10-20 14:37:15 +00:00
--
-- Name: commentflags commentflags_comment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.commentflags
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT commentflags_comment_id_fkey FOREIGN KEY (comment_id) REFERENCES public.comments(id);
2021-10-20 14:37:15 +00:00
--
-- Name: flags flags_post_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.flags
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT flags_post_id_fkey FOREIGN KEY (post_id) REFERENCES public.submissions(id);
2021-10-20 14:37:15 +00:00
--
-- Name: notifications notifications_comment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.notifications
2021-10-23 17:02:50 +00:00
ADD CONSTRAINT notifications_comment_id_fkey FOREIGN KEY (comment_id) REFERENCES public.comments(id);
2022-01-19 09:19:22 +00:00