diff --git a/schema.sql b/schema.sql index 7d8f471cd..a28a30a2a 100644 --- a/schema.sql +++ b/schema.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 10.18 (Ubuntu 10.18-1.pgdg20.04+1) --- Dumped by pg_dump version 10.18 (Ubuntu 10.18-1.pgdg20.04+1) +-- Dumped from database version 13.4 +-- Dumped by pg_dump version 13.4 (Ubuntu 13.4-1.pgdg20.04+1) SET statement_timeout = 0; SET lock_timeout = 0; @@ -16,280 +16,43 @@ SET xmloption = content; SET client_min_messages = warning; SET row_security = off; -ALTER TABLE IF EXISTS ONLY public.notifications DROP CONSTRAINT IF EXISTS notifications_comment_id_fkey; -ALTER TABLE IF EXISTS ONLY public.flags DROP CONSTRAINT IF EXISTS flags_post_id_fkey; -ALTER TABLE IF EXISTS ONLY public.commentflags DROP CONSTRAINT IF EXISTS commentflags_comment_id_fkey; -ALTER TABLE IF EXISTS ONLY public.badges DROP CONSTRAINT IF EXISTS badges_badge_id_fkey; -DROP INDEX IF EXISTS public.votes_type_index; -DROP INDEX IF EXISTS public.votes_submission_id_index; -DROP INDEX IF EXISTS public.vote_user_index; -DROP INDEX IF EXISTS public.users_username_trgm_idx; -DROP INDEX IF EXISTS public.users_unbanutc_idx; -DROP INDEX IF EXISTS public.users_subs_idx; -DROP INDEX IF EXISTS public.users_original_username_trgm_idx; -DROP INDEX IF EXISTS public.users_created_utc_index; -DROP INDEX IF EXISTS public.userblocks_both_idx; -DROP INDEX IF EXISTS public.user_private_idx; -DROP INDEX IF EXISTS public.user_privacy_idx; -DROP INDEX IF EXISTS public.user_banned_idx; -DROP INDEX IF EXISTS public.subscription_user_index; -DROP INDEX IF EXISTS public.subscription_board_index; -DROP INDEX IF EXISTS public.submissions_score_idx; -DROP INDEX IF EXISTS public.submissions_over18_index; -DROP INDEX IF EXISTS public.submissions_offensive_index; -DROP INDEX IF EXISTS public.submissions_created_utc_desc_idx; -DROP INDEX IF EXISTS public.submissions_author_index; -DROP INDEX IF EXISTS public.submission_purge_idx; -DROP INDEX IF EXISTS public.submission_pinned_idx; -DROP INDEX IF EXISTS public.submission_new_sort_idx; -DROP INDEX IF EXISTS public.submission_isdeleted_idx; -DROP INDEX IF EXISTS public.submission_isbanned_idx; -DROP INDEX IF EXISTS public.submission_hot_sort_idx; -DROP INDEX IF EXISTS public.submission_domainref_index; -DROP INDEX IF EXISTS public.submission_disputed_sort_idx; -DROP INDEX IF EXISTS public.submission_best_only_idx; -DROP INDEX IF EXISTS public.subimssion_binary_group_idx; -DROP INDEX IF EXISTS public.sub_user_index; -DROP INDEX IF EXISTS public.post_public_idx; -DROP INDEX IF EXISTS public.post_offensive_index; -DROP INDEX IF EXISTS public.post_author_index; -DROP INDEX IF EXISTS public.post_app_id_idx; -DROP INDEX IF EXISTS public.post_18_index; -DROP INDEX IF EXISTS public.notifs_user_read_idx; -DROP INDEX IF EXISTS public.notifications_user_index; -DROP INDEX IF EXISTS public.notifications_comment_idx; -DROP INDEX IF EXISTS public.notification_read_idx; -DROP INDEX IF EXISTS public.modaction_pid_idx; -DROP INDEX IF EXISTS public.modaction_id_idx; -DROP INDEX IF EXISTS public.modaction_cid_idx; -DROP INDEX IF EXISTS public.modaction_action_idx; -DROP INDEX IF EXISTS public.follow_user_id_index; -DROP INDEX IF EXISTS public.follow_target_id_index; -DROP INDEX IF EXISTS public.flags_post_index; -DROP INDEX IF EXISTS public.flag_user_idx; -DROP INDEX IF EXISTS public.domains_domain_trgm_idx; -DROP INDEX IF EXISTS public.domain_ref_idx; -DROP INDEX IF EXISTS public.discord_id_idx; -DROP INDEX IF EXISTS public.cvote_user_index; -DROP INDEX IF EXISTS public.commentvotes_comments_type_index; -DROP INDEX IF EXISTS public.commentvotes_comments_id_index; -DROP INDEX IF EXISTS public.comments_user_index; -DROP INDEX IF EXISTS public.comments_parent_id_idx; -DROP INDEX IF EXISTS public.commentflag_comment_index; -DROP INDEX IF EXISTS public.comment_post_id_index; -DROP INDEX IF EXISTS public.comment_parent_index; -DROP INDEX IF EXISTS public.cflag_user_idx; -DROP INDEX IF EXISTS public.block_user_idx; -DROP INDEX IF EXISTS public.block_target_idx; -DROP INDEX IF EXISTS public.badpics_phash_index; -DROP INDEX IF EXISTS public.badpic_phash_trgm_idx; -DROP INDEX IF EXISTS public.badpic_phash_idx; -DROP INDEX IF EXISTS public.badlink_link_idx; -DROP INDEX IF EXISTS public.badges_user_index; -DROP INDEX IF EXISTS public.badges_badge_id_idx; -DROP INDEX IF EXISTS public.badgedef_qual_idx; -DROP INDEX IF EXISTS public.award_user_idx; -DROP INDEX IF EXISTS public.award_post_idx; -DROP INDEX IF EXISTS public.award_comment_idx; -DROP INDEX IF EXISTS public.alts_user2_idx; -DROP INDEX IF EXISTS public.alts_user1_idx; -ALTER TABLE IF EXISTS ONLY public.votes DROP CONSTRAINT IF EXISTS votes_pkey; -ALTER TABLE IF EXISTS ONLY public.viewers DROP CONSTRAINT IF EXISTS viewers_pkey; -ALTER TABLE IF EXISTS ONLY public.users DROP CONSTRAINT IF EXISTS users_username_key; -ALTER TABLE IF EXISTS ONLY public.users DROP CONSTRAINT IF EXISTS users_pkey; -ALTER TABLE IF EXISTS ONLY public.users DROP CONSTRAINT IF EXISTS users_original_username_key; -ALTER TABLE IF EXISTS ONLY public.users DROP CONSTRAINT IF EXISTS users_email_key; -ALTER TABLE IF EXISTS ONLY public.alts DROP CONSTRAINT IF EXISTS userpair; -ALTER TABLE IF EXISTS ONLY public.userblocks DROP CONSTRAINT IF EXISTS userblocks_pkey; -ALTER TABLE IF EXISTS ONLY public.badges DROP CONSTRAINT IF EXISTS user_badge_constraint; -ALTER TABLE IF EXISTS ONLY public.oauth_apps DROP CONSTRAINT IF EXISTS unique_id; -ALTER TABLE IF EXISTS ONLY public.client_auths DROP CONSTRAINT IF EXISTS unique_access; -ALTER TABLE IF EXISTS ONLY public.subscriptions DROP CONSTRAINT IF EXISTS subscriptions_pkey; -ALTER TABLE IF EXISTS ONLY public.submissions DROP CONSTRAINT IF EXISTS submissions_pkey; -ALTER TABLE IF EXISTS ONLY public.save_relationship DROP CONSTRAINT IF EXISTS save_relationship_pkey; -ALTER TABLE IF EXISTS ONLY public.save_relationship DROP CONSTRAINT IF EXISTS save_constraint; -ALTER TABLE IF EXISTS ONLY public.votes DROP CONSTRAINT IF EXISTS onevote; -ALTER TABLE IF EXISTS ONLY public.commentvotes DROP CONSTRAINT IF EXISTS onecvote; -ALTER TABLE IF EXISTS ONLY public.notifications DROP CONSTRAINT IF EXISTS one_notif; -ALTER TABLE IF EXISTS ONLY public.users DROP CONSTRAINT IF EXISTS one_discord_account; -ALTER TABLE IF EXISTS ONLY public.oauth_apps DROP CONSTRAINT IF EXISTS oauth_apps_pkey; -ALTER TABLE IF EXISTS ONLY public.notifications DROP CONSTRAINT IF EXISTS notifications_pkey; -ALTER TABLE IF EXISTS ONLY public.modactions DROP CONSTRAINT IF EXISTS modactions_pkey; -ALTER TABLE IF EXISTS ONLY public.images DROP CONSTRAINT IF EXISTS images_pkey; -ALTER TABLE IF EXISTS ONLY public.subscriptions DROP CONSTRAINT IF EXISTS guild_membership_unique; -ALTER TABLE IF EXISTS ONLY public.follows DROP CONSTRAINT IF EXISTS follows_pkey; -ALTER TABLE IF EXISTS ONLY public.follows DROP CONSTRAINT IF EXISTS follow_membership_unique; -ALTER TABLE IF EXISTS ONLY public.flags DROP CONSTRAINT IF EXISTS flags_pkey; -ALTER TABLE IF EXISTS ONLY public.banneddomains DROP CONSTRAINT IF EXISTS domains_pkey; -ALTER TABLE IF EXISTS ONLY public.banneddomains DROP CONSTRAINT IF EXISTS domains_domain_key; -ALTER TABLE IF EXISTS ONLY public.commentvotes DROP CONSTRAINT IF EXISTS commentvotes_pkey; -ALTER TABLE IF EXISTS ONLY public.comments DROP CONSTRAINT IF EXISTS comments_pkey; -ALTER TABLE IF EXISTS ONLY public.commentflags DROP CONSTRAINT IF EXISTS commentflags_pkey; -ALTER TABLE IF EXISTS ONLY public.client_auths DROP CONSTRAINT IF EXISTS client_auths_pkey; -ALTER TABLE IF EXISTS ONLY public.badpics DROP CONSTRAINT IF EXISTS badpics_pkey; -ALTER TABLE IF EXISTS ONLY public.badlinks DROP CONSTRAINT IF EXISTS badlinks_pkey; -ALTER TABLE IF EXISTS ONLY public.badges DROP CONSTRAINT IF EXISTS badges_pkey; -ALTER TABLE IF EXISTS ONLY public.badge_defs DROP CONSTRAINT IF EXISTS badge_list_icon_key; -ALTER TABLE IF EXISTS ONLY public.badge_defs DROP CONSTRAINT IF EXISTS badge_defs_pkey; -ALTER TABLE IF EXISTS ONLY public.award_relationships DROP CONSTRAINT IF EXISTS award_relationships_pkey; -ALTER TABLE IF EXISTS ONLY public.award_relationships DROP CONSTRAINT IF EXISTS award_constraint; -ALTER TABLE IF EXISTS ONLY public.alts DROP CONSTRAINT IF EXISTS alts_pkey; -ALTER TABLE IF EXISTS public.votes ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.viewers ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.users ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.userblocks ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.subscriptions ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.submissions ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.save_relationship ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.oauth_apps ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.notifications ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.modactions ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.images ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.follows ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.flags ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.commentvotes ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.comments ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.commentflags ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.client_auths ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.banneddomains ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.badpics ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.badlinks ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.badges ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.badge_defs ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.award_relationships ALTER COLUMN id DROP DEFAULT; -ALTER TABLE IF EXISTS public.alts ALTER COLUMN id DROP DEFAULT; -DROP SEQUENCE IF EXISTS public.votes_id_seq; -DROP TABLE IF EXISTS public.votes; -DROP SEQUENCE IF EXISTS public.viewers_id_seq; -DROP TABLE IF EXISTS public.viewers; -DROP SEQUENCE IF EXISTS public.users_id_seq; -DROP TABLE IF EXISTS public.users; -DROP SEQUENCE IF EXISTS public.userblocks_id_seq; -DROP TABLE IF EXISTS public.userblocks; -DROP SEQUENCE IF EXISTS public.subscriptions_id_seq; -DROP TABLE IF EXISTS public.subscriptions; -DROP SEQUENCE IF EXISTS public.submissions_id_seq; -DROP SEQUENCE IF EXISTS public.save_relationship_id_seq; -DROP TABLE IF EXISTS public.save_relationship; -DROP SEQUENCE IF EXISTS public.oauth_apps_id_seq; -DROP TABLE IF EXISTS public.oauth_apps; -DROP SEQUENCE IF EXISTS public.notifications_id_seq; -DROP TABLE IF EXISTS public.notifications; -DROP SEQUENCE IF EXISTS public.modactions_id_seq; -DROP TABLE IF EXISTS public.modactions; -DROP SEQUENCE IF EXISTS public.images_id_seq; -DROP TABLE IF EXISTS public.images; -DROP SEQUENCE IF EXISTS public.follows_id_seq; -DROP TABLE IF EXISTS public.follows; -DROP SEQUENCE IF EXISTS public.flags_id_seq; -DROP TABLE IF EXISTS public.flags; -DROP SEQUENCE IF EXISTS public.domains_id_seq; -DROP SEQUENCE IF EXISTS public.commentvotes_id_seq; -DROP TABLE IF EXISTS public.commentvotes; -DROP SEQUENCE IF EXISTS public.comments_id_seq; -DROP SEQUENCE IF EXISTS public.commentflags_id_seq; -DROP TABLE IF EXISTS public.commentflags; -DROP SEQUENCE IF EXISTS public.client_auths_id_seq; -DROP TABLE IF EXISTS public.client_auths; -DROP TABLE IF EXISTS public.banneddomains; -DROP SEQUENCE IF EXISTS public.badpics_id_seq; -DROP TABLE IF EXISTS public.badpics; -DROP SEQUENCE IF EXISTS public.badlinks_id_seq; -DROP TABLE IF EXISTS public.badlinks; -DROP SEQUENCE IF EXISTS public.badges_id_seq; -DROP TABLE IF EXISTS public.badges; -DROP SEQUENCE IF EXISTS public.badge_list_id_seq; -DROP TABLE IF EXISTS public.badge_defs; -DROP SEQUENCE IF EXISTS public.award_relationships_id_seq; -DROP TABLE IF EXISTS public.award_relationships; -DROP SEQUENCE IF EXISTS public.alts_id_seq; -DROP TABLE IF EXISTS public.alts; -DROP FUNCTION IF EXISTS public.score_disputed(public.comments); -DROP FUNCTION IF EXISTS public.score(public.submissions); -DROP FUNCTION IF EXISTS public.score(public.comments); -DROP TABLE IF EXISTS public.comments; -DROP FUNCTION IF EXISTS public.hotscore(public.submissions); -DROP FUNCTION IF EXISTS public.age(public.submissions); -DROP TABLE IF EXISTS public.submissions; -DROP EXTENSION IF EXISTS pg_trgm; -DROP EXTENSION IF EXISTS pg_stat_statements; -DROP EXTENSION IF EXISTS fuzzystrmatch; -DROP EXTENSION IF EXISTS plpgsql; -DROP SCHEMA IF EXISTS public; -- --- Name: DATABASE postgres; Type: COMMENT; Schema: -; Owner: postgres --- - -COMMENT ON DATABASE postgres IS 'default administrative connection database'; - - --- --- Name: public; Type: SCHEMA; Schema: -; Owner: postgres --- - -CREATE SCHEMA public; - - -ALTER SCHEMA public OWNER TO postgres; - --- --- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres --- - -COMMENT ON SCHEMA public IS 'standard public schema'; - - --- --- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: --- - -CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; - - --- --- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: --- - -COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; - - --- --- Name: fuzzystrmatch; Type: EXTENSION; Schema: -; Owner: +-- Name: fuzzystrmatch; Type: EXTENSION; Schema: -; Owner: - -- CREATE EXTENSION IF NOT EXISTS fuzzystrmatch WITH SCHEMA public; -- --- Name: EXTENSION fuzzystrmatch; Type: COMMENT; Schema: -; Owner: +-- 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: +-- 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: +-- Name: EXTENSION pg_stat_statements; Type: COMMENT; Schema: -; Owner: - -- -COMMENT ON EXTENSION pg_stat_statements IS 'track execution statistics of all SQL statements executed'; +COMMENT ON EXTENSION pg_stat_statements IS 'track planning and execution statistics of all SQL statements executed'; -- --- Name: pg_trgm; Type: EXTENSION; Schema: -; Owner: +-- 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: +-- Name: EXTENSION pg_trgm; Type: COMMENT; Schema: -; Owner: - -- COMMENT ON EXTENSION pg_trgm IS 'text similarity measurement and index searching based on trigrams'; @@ -297,93 +60,282 @@ COMMENT ON EXTENSION pg_trgm IS 'text similarity measurement and index searching SET default_tablespace = ''; -SET default_with_oids = false; +SET default_table_access_method = heap; -- --- Name: submissions; Type: TABLE; Schema: public; Owner: postgres +-- Name: alts; Type: TABLE; Schema: public; Owner: - -- -CREATE TABLE public.submissions ( +CREATE TABLE public.alts ( id integer NOT NULL, - author_id integer, - created_utc integer NOT NULL, - is_banned boolean, - over_18 boolean, - distinguish_level integer, - created_str character varying(255), - deleted_utc integer NOT NULL, - domain_ref integer, - is_approved integer NOT NULL, - approved_utc integer, - edited_utc integer, - mod_approved integer, - has_thumb boolean, - accepted_utc integer, - post_public boolean, - score_hot double precision, - score_top integer, - score_activity double precision, - score_disputed double precision, - is_offensive boolean, - is_pinned boolean, - is_nsfl boolean, - repost_id integer, - score_best double precision, - upvotes integer, - downvotes integer, - app_id integer, - creation_region character(2) DEFAULT NULL::bpchar, - purged_utc integer DEFAULT 0, - is_bot boolean DEFAULT false, - thumburl text, - private boolean, - views integer, - banaward text, - bannedfor boolean, - comment_count integer DEFAULT 0, - processing boolean DEFAULT false, - removed_by integer, - club boolean, - 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), - title_html text, - stickied text + user1 integer NOT NULL, + user2 integer NOT NULL, + is_manual boolean DEFAULT false ); -ALTER TABLE public.submissions OWNER TO postgres; - -- --- Name: age(public.submissions); Type: FUNCTION; Schema: public; Owner: postgres +-- Name: alts_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- -CREATE FUNCTION public.age(public.submissions) RETURNS integer - LANGUAGE sql IMMUTABLE STRICT - AS $_$ - SELECT CAST( EXTRACT( EPOCH FROM CURRENT_TIMESTAMP) AS int) - $1.created_utc $_$; +CREATE SEQUENCE public.alts_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; -ALTER FUNCTION public.age(public.submissions) OWNER TO postgres; - -- --- Name: hotscore(public.submissions); Type: FUNCTION; Schema: public; Owner: postgres +-- Name: alts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- -CREATE FUNCTION public.hotscore(public.submissions) RETURNS double precision - LANGUAGE sql IMMUTABLE STRICT - AS $_$ - SELECT 10000000.0*CAST(($1.upvotes - $1.downvotes + 1) AS float)/((CAST(($1.age+3600) AS FLOAT)/1000.0)^(1.35)) - $_$; +ALTER SEQUENCE public.alts_id_seq OWNED BY public.alts.id; -ALTER FUNCTION public.hotscore(public.submissions) OWNER TO postgres; - -- --- Name: comments; Type: TABLE; Schema: public; Owner: postgres +-- Name: award_relationships; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.award_relationships ( + id integer NOT NULL, + user_id integer, + submission_id integer, + comment_id integer, + kind character varying(20) +); + + +-- +-- Name: award_relationships_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.award_relationships_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- 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; + + +-- +-- Name: badge_defs; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.badge_defs ( + id integer NOT NULL, + name character varying(64), + description character varying(256), + icon character varying(64), + kind integer, + qualification_expr character varying(128) +); + + +-- +-- Name: badge_list_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.badge_list_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: badge_list_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.badge_list_id_seq OWNED BY public.badge_defs.id; + + +-- +-- Name: badges; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.badges ( + id integer NOT NULL, + badge_id integer, + user_id integer, + description character varying(256), + url character varying(256) +); + + +-- +-- Name: badges_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.badges_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: badges_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.badges_id_seq OWNED BY public.badges.id; + + +-- +-- Name: badlinks; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.badlinks ( + id integer NOT NULL, + reason text, + link character varying(512), + autoban boolean +); + + +-- +-- Name: badlinks_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.badlinks_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: badlinks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.badlinks_id_seq OWNED BY public.badlinks.id; + + +-- +-- Name: badpics; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.badpics ( + id integer NOT NULL, + description character varying(255), + phash character varying(64), + ban_reason character varying(64), + ban_time integer DEFAULT 0 NOT NULL +); + + +-- +-- Name: badpics_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.badpics_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: badpics_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.badpics_id_seq OWNED BY public.badpics.id; + + +-- +-- Name: banneddomains; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.banneddomains ( + id integer NOT NULL, + domain character varying(100), + reason text +); + + +-- +-- Name: client_auths; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.client_auths ( + id integer NOT NULL, + user_id integer, + oauth_client integer, + access_token character(128) +); + + +-- +-- Name: client_auths_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.client_auths_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- 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 ( + id integer NOT NULL, + user_id integer, + comment_id integer, + reason text +); + + +-- +-- Name: commentflags_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.commentflags_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- 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 ( @@ -392,7 +344,6 @@ CREATE TABLE public.comments ( created_utc integer NOT NULL, parent_submission integer, is_banned boolean, - parent_fullname character varying(255), distinguish_level integer, edited_utc integer, deleted_utc integer NOT NULL, @@ -407,375 +358,18 @@ CREATE TABLE public.comments ( is_bot boolean DEFAULT false, app_id integer, sentto integer, - shadowbanned boolean, - banaward text, bannedfor boolean, removed_by integer, - body character varying(10000), - body_html character varying(20000), - ban_reason character varying(256), is_pinned text, + body character varying(10000), + body_html character varying(40000), + ban_reason character varying(256), notifiedto integer ); -ALTER TABLE public.comments OWNER TO postgres; - -- --- Name: score(public.comments); Type: FUNCTION; Schema: public; Owner: postgres --- - -CREATE FUNCTION public.score(public.comments) RETURNS integer - LANGUAGE sql IMMUTABLE STRICT - AS $_$ - SELECT $1.upvotes - $1.downvotes - $_$; - - -ALTER FUNCTION public.score(public.comments) OWNER TO postgres; - --- --- Name: score(public.submissions); Type: FUNCTION; Schema: public; Owner: postgres --- - -CREATE FUNCTION public.score(public.submissions) RETURNS integer - LANGUAGE sql IMMUTABLE STRICT - AS $_$ - SELECT $1.upvotes - $1.downvotes - $_$; - - -ALTER FUNCTION public.score(public.submissions) OWNER TO postgres; - --- --- Name: score_disputed(public.comments); Type: FUNCTION; Schema: public; Owner: postgres --- - -CREATE FUNCTION public.score_disputed(public.comments) RETURNS integer - LANGUAGE sql IMMUTABLE STRICT - AS $_$ - SELECT $1.upvotes * $1.downvotes - $_$; - - -ALTER FUNCTION public.score_disputed(public.comments) OWNER TO postgres; - --- --- Name: alts; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.alts ( - id integer NOT NULL, - user1 integer NOT NULL, - user2 integer NOT NULL, - is_manual boolean DEFAULT false -); - - -ALTER TABLE public.alts OWNER TO postgres; - --- --- Name: alts_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -CREATE SEQUENCE public.alts_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE public.alts_id_seq OWNER TO postgres; - --- --- Name: alts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE public.alts_id_seq OWNED BY public.alts.id; - - --- --- Name: award_relationships; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.award_relationships ( - id integer NOT NULL, - user_id integer, - submission_id integer, - comment_id integer, - kind character varying(20) -); - - -ALTER TABLE public.award_relationships OWNER TO postgres; - --- --- Name: award_relationships_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -CREATE SEQUENCE public.award_relationships_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE public.award_relationships_id_seq OWNER TO postgres; - --- --- Name: award_relationships_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE public.award_relationships_id_seq OWNED BY public.award_relationships.id; - - --- --- Name: badge_defs; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.badge_defs ( - id integer NOT NULL, - name character varying(64), - description character varying(256), - icon character varying(64), - kind integer, - rank integer, - qualification_expr character varying(128) -); - - -ALTER TABLE public.badge_defs OWNER TO postgres; - --- --- Name: badge_list_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -CREATE SEQUENCE public.badge_list_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE public.badge_list_id_seq OWNER TO postgres; - --- --- Name: badge_list_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE public.badge_list_id_seq OWNED BY public.badge_defs.id; - - --- --- Name: badges; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.badges ( - id integer NOT NULL, - badge_id integer, - user_id integer, - description character varying(256), - url character varying(256) -); - - -ALTER TABLE public.badges OWNER TO postgres; - --- --- Name: badges_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -CREATE SEQUENCE public.badges_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE public.badges_id_seq OWNER TO postgres; - --- --- Name: badges_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE public.badges_id_seq OWNED BY public.badges.id; - - --- --- Name: badlinks; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.badlinks ( - id integer NOT NULL, - reason integer, - link character varying(512), - autoban boolean -); - - -ALTER TABLE public.badlinks OWNER TO postgres; - --- --- Name: badlinks_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -CREATE SEQUENCE public.badlinks_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE public.badlinks_id_seq OWNER TO postgres; - --- --- Name: badlinks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE public.badlinks_id_seq OWNED BY public.badlinks.id; - - --- --- Name: badpics; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.badpics ( - id integer NOT NULL, - description character varying(255), - phash character varying(64), - ban_reason character varying(64), - ban_time integer DEFAULT 0 NOT NULL -); - - -ALTER TABLE public.badpics OWNER TO postgres; - --- --- Name: badpics_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -CREATE SEQUENCE public.badpics_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE public.badpics_id_seq OWNER TO postgres; - --- --- Name: badpics_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE public.badpics_id_seq OWNED BY public.badpics.id; - - --- --- Name: banneddomains; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.banneddomains ( - id integer NOT NULL, - domain character varying(100), - can_submit boolean, - can_comment boolean, - reason integer, - show_thumbnail boolean, - embed_function character varying(64), - embed_template character varying(32) DEFAULT NULL::character varying, - sandbox_embed boolean DEFAULT false -); - - -ALTER TABLE public.banneddomains OWNER TO postgres; - --- --- Name: client_auths; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.client_auths ( - id integer NOT NULL, - user_id integer, - oauth_client integer, - scope_guildmaster boolean, - access_token character(128) -); - - -ALTER TABLE public.client_auths OWNER TO postgres; - --- --- Name: client_auths_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -CREATE SEQUENCE public.client_auths_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE public.client_auths_id_seq OWNER TO postgres; - --- --- Name: client_auths_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE public.client_auths_id_seq OWNED BY public.client_auths.id; - - --- --- Name: commentflags; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.commentflags ( - id integer NOT NULL, - user_id integer, - comment_id integer, - reason text -); - - -ALTER TABLE public.commentflags OWNER TO postgres; - --- --- Name: commentflags_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -CREATE SEQUENCE public.commentflags_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE public.commentflags_id_seq OWNER TO postgres; - --- --- Name: commentflags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE public.commentflags_id_seq OWNED BY public.commentflags.id; - - --- --- Name: comments_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- Name: comments_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.comments_id_seq @@ -787,17 +381,15 @@ CREATE SEQUENCE public.comments_id_seq CACHE 1; -ALTER TABLE public.comments_id_seq OWNER TO postgres; - -- --- Name: comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- 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: postgres +-- Name: commentvotes; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.commentvotes ( @@ -810,10 +402,8 @@ CREATE TABLE public.commentvotes ( ); -ALTER TABLE public.commentvotes OWNER TO postgres; - -- --- Name: commentvotes_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- Name: commentvotes_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.commentvotes_id_seq @@ -825,17 +415,15 @@ CREATE SEQUENCE public.commentvotes_id_seq CACHE 1; -ALTER TABLE public.commentvotes_id_seq OWNER TO postgres; - -- --- Name: commentvotes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- 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: postgres +-- Name: domains_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.domains_id_seq @@ -847,17 +435,15 @@ CREATE SEQUENCE public.domains_id_seq CACHE 1; -ALTER TABLE public.domains_id_seq OWNER TO postgres; - -- --- Name: domains_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- 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: postgres +-- Name: flags; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.flags ( @@ -868,10 +454,8 @@ CREATE TABLE public.flags ( ); -ALTER TABLE public.flags OWNER TO postgres; - -- --- Name: flags_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- Name: flags_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.flags_id_seq @@ -883,17 +467,15 @@ CREATE SEQUENCE public.flags_id_seq CACHE 1; -ALTER TABLE public.flags_id_seq OWNER TO postgres; - -- --- Name: flags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- 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: postgres +-- Name: follows; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.follows ( @@ -903,10 +485,8 @@ CREATE TABLE public.follows ( ); -ALTER TABLE public.follows OWNER TO postgres; - -- --- Name: follows_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- Name: follows_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.follows_id_seq @@ -918,17 +498,15 @@ CREATE SEQUENCE public.follows_id_seq CACHE 1; -ALTER TABLE public.follows_id_seq OWNER TO postgres; - -- --- Name: follows_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- Name: follows_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.follows_id_seq OWNED BY public.follows.id; -- --- Name: images; Type: TABLE; Schema: public; Owner: postgres +-- Name: images; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.images ( @@ -940,10 +518,8 @@ CREATE TABLE public.images ( ); -ALTER TABLE public.images OWNER TO postgres; - -- --- Name: images_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- Name: images_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.images_id_seq @@ -955,17 +531,15 @@ CREATE SEQUENCE public.images_id_seq CACHE 1; -ALTER TABLE public.images_id_seq OWNER TO postgres; - -- --- Name: images_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- Name: images_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.images_id_seq OWNED BY public.images.id; -- --- Name: modactions; Type: TABLE; Schema: public; Owner: postgres +-- Name: modactions; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.modactions ( @@ -976,14 +550,12 @@ CREATE TABLE public.modactions ( target_comment_id integer, created_utc integer DEFAULT 0, kind character varying(32) DEFAULT NULL::character varying, - _note character varying(256) DEFAULT NULL::character varying + _note text DEFAULT NULL::character varying ); -ALTER TABLE public.modactions OWNER TO postgres; - -- --- Name: modactions_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- Name: modactions_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.modactions_id_seq @@ -995,17 +567,15 @@ CREATE SEQUENCE public.modactions_id_seq CACHE 1; -ALTER TABLE public.modactions_id_seq OWNER TO postgres; - -- --- Name: modactions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- Name: modactions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.modactions_id_seq OWNED BY public.modactions.id; -- --- Name: notifications; Type: TABLE; Schema: public; Owner: postgres +-- Name: notifications; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.notifications ( @@ -1016,15 +586,13 @@ CREATE TABLE public.notifications ( followsender integer, unfollowsender integer, blocksender integer, - removefollowsender integer, - unblocksender integer + unblocksender integer, + removefollowsender integer ); -ALTER TABLE public.notifications OWNER TO postgres; - -- --- Name: notifications_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- Name: notifications_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.notifications_id_seq @@ -1036,17 +604,15 @@ CREATE SEQUENCE public.notifications_id_seq CACHE 1; -ALTER TABLE public.notifications_id_seq OWNER TO postgres; - -- --- Name: notifications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- 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: postgres +-- Name: oauth_apps; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.oauth_apps ( @@ -1059,10 +625,8 @@ CREATE TABLE public.oauth_apps ( ); -ALTER TABLE public.oauth_apps OWNER TO postgres; - -- --- Name: oauth_apps_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- Name: oauth_apps_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.oauth_apps_id_seq @@ -1074,17 +638,15 @@ CREATE SEQUENCE public.oauth_apps_id_seq CACHE 1; -ALTER TABLE public.oauth_apps_id_seq OWNER TO postgres; - -- --- Name: oauth_apps_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- 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: postgres +-- Name: save_relationship; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.save_relationship ( @@ -1095,10 +657,8 @@ CREATE TABLE public.save_relationship ( ); -ALTER TABLE public.save_relationship OWNER TO postgres; - -- --- Name: save_relationship_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- Name: save_relationship_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.save_relationship_id_seq @@ -1110,17 +670,54 @@ CREATE SEQUENCE public.save_relationship_id_seq CACHE 1; -ALTER TABLE public.save_relationship_id_seq OWNER TO postgres; - -- --- Name: save_relationship_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- 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_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- Name: submissions; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.submissions ( + id integer NOT NULL, + author_id integer, + created_utc integer NOT NULL, + is_banned boolean, + over_18 boolean, + distinguish_level integer, + created_str character varying(255), + 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 text, + private boolean, + views integer, + is_bot boolean, + bannedfor boolean, + comment_count integer DEFAULT 0, + removed_by integer, + club boolean, + 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), + title_html text +); + + +-- +-- Name: submissions_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.submissions_id_seq @@ -1132,17 +729,15 @@ CREATE SEQUENCE public.submissions_id_seq CACHE 1; -ALTER TABLE public.submissions_id_seq OWNER TO postgres; - -- --- Name: submissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- Name: submissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE public.submissions_id_seq OWNED BY public.submissions.id; -- --- Name: subscriptions; Type: TABLE; Schema: public; Owner: postgres +-- Name: subscriptions; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.subscriptions ( @@ -1153,10 +748,8 @@ CREATE TABLE public.subscriptions ( ); -ALTER TABLE public.subscriptions OWNER TO postgres; - -- --- Name: subscriptions_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- Name: subscriptions_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.subscriptions_id_seq @@ -1168,17 +761,15 @@ CREATE SEQUENCE public.subscriptions_id_seq CACHE 1; -ALTER TABLE public.subscriptions_id_seq OWNER TO postgres; - -- --- Name: subscriptions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- 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: postgres +-- Name: userblocks; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.userblocks ( @@ -1188,10 +779,8 @@ CREATE TABLE public.userblocks ( ); -ALTER TABLE public.userblocks OWNER TO postgres; - -- --- Name: userblocks_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- Name: userblocks_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.userblocks_id_seq @@ -1203,17 +792,15 @@ CREATE SEQUENCE public.userblocks_id_seq CACHE 1; -ALTER TABLE public.userblocks_id_seq OWNER TO postgres; - -- --- Name: userblocks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- 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: postgres +-- Name: users; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.users ( @@ -1225,8 +812,8 @@ CREATE TABLE public.users ( admin_level integer, over_18 boolean, is_activated boolean, - bio character varying(300), - bio_html character varying(1000), + bio character varying(1500), + bio_html character varying(10000), referred_by integer, is_banned integer, ban_reason character varying(128), @@ -1255,7 +842,7 @@ CREATE TABLE public.users ( theme text, song text, slurreplacer boolean, - shadowbanned boolean, + shadowbanned text, newtabexternal boolean, customtitleplain text, themecolor text, @@ -1267,37 +854,30 @@ CREATE TABLE public.users ( agendaposter boolean, agendaposter_expires_utc integer DEFAULT 0, resized boolean, - banawards integer, - animatedname boolean, suicide_utc integer, - highres text, post_count integer, comment_count integer, + highres text, rent_utc integer, - zzz boolean, + patron integer, controversial boolean, background text, - verified character varying(20), - patron integer, - quadrant text, - steal_utc integer, + verified text, fail_utc integer, + steal_utc integer, fail2_utc integer, cardview boolean, - basedcount integer, received_award_count integer, highlightcomments boolean, - club_banned boolean, + club_banned boolean DEFAULT false, nitter boolean, truecoins integer, club_allowed boolean DEFAULT false ); -ALTER TABLE public.users OWNER TO postgres; - -- --- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.users_id_seq @@ -1309,17 +889,15 @@ CREATE SEQUENCE public.users_id_seq CACHE 1; -ALTER TABLE public.users_id_seq OWNER TO postgres; - -- --- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- 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: postgres +-- Name: viewers; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.viewers ( @@ -1330,10 +908,8 @@ CREATE TABLE public.viewers ( ); -ALTER TABLE public.viewers OWNER TO postgres; - -- --- Name: viewers_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- Name: viewers_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.viewers_id_seq @@ -1345,17 +921,15 @@ CREATE SEQUENCE public.viewers_id_seq CACHE 1; -ALTER TABLE public.viewers_id_seq OWNER TO postgres; - -- --- Name: viewers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- 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: postgres +-- Name: votes; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.votes ( @@ -1368,10 +942,8 @@ CREATE TABLE public.votes ( ); -ALTER TABLE public.votes OWNER TO postgres; - -- --- Name: votes_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- Name: votes_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE public.votes_id_seq @@ -1383,185 +955,183 @@ CREATE SEQUENCE public.votes_id_seq CACHE 1; -ALTER TABLE public.votes_id_seq OWNER TO postgres; - -- --- Name: votes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- 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: postgres +-- 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: postgres +-- 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); -- --- Name: badge_defs id; Type: DEFAULT; Schema: public; Owner: postgres +-- Name: badge_defs id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.badge_defs ALTER COLUMN id SET DEFAULT nextval('public.badge_list_id_seq'::regclass); -- --- Name: badges id; Type: DEFAULT; Schema: public; Owner: postgres +-- 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: badlinks id; Type: DEFAULT; Schema: public; Owner: postgres +-- Name: badlinks id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.badlinks ALTER COLUMN id SET DEFAULT nextval('public.badlinks_id_seq'::regclass); -- --- Name: badpics id; Type: DEFAULT; Schema: public; Owner: postgres +-- Name: badpics id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.badpics ALTER COLUMN id SET DEFAULT nextval('public.badpics_id_seq'::regclass); -- --- Name: banneddomains id; Type: DEFAULT; Schema: public; Owner: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: images id; Type: DEFAULT; Schema: public; Owner: postgres +-- Name: images id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.images ALTER COLUMN id SET DEFAULT nextval('public.images_id_seq'::regclass); -- --- Name: modactions id; Type: DEFAULT; Schema: public; Owner: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- Name: alts alts_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.alts @@ -1569,7 +1139,7 @@ ALTER TABLE ONLY public.alts -- --- Name: award_relationships award_constraint; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: award_relationships award_constraint; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.award_relationships @@ -1577,7 +1147,7 @@ ALTER TABLE ONLY public.award_relationships -- --- Name: award_relationships award_relationships_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: award_relationships award_relationships_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.award_relationships @@ -1585,7 +1155,7 @@ ALTER TABLE ONLY public.award_relationships -- --- Name: badge_defs badge_defs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: badge_defs badge_defs_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.badge_defs @@ -1593,7 +1163,7 @@ ALTER TABLE ONLY public.badge_defs -- --- Name: badge_defs badge_list_icon_key; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: badge_defs badge_list_icon_key; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.badge_defs @@ -1601,7 +1171,7 @@ ALTER TABLE ONLY public.badge_defs -- --- Name: badges badges_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: badges badges_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.badges @@ -1609,7 +1179,7 @@ ALTER TABLE ONLY public.badges -- --- Name: badlinks badlinks_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: badlinks badlinks_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.badlinks @@ -1617,7 +1187,7 @@ ALTER TABLE ONLY public.badlinks -- --- Name: badpics badpics_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: badpics badpics_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.badpics @@ -1625,7 +1195,7 @@ ALTER TABLE ONLY public.badpics -- --- Name: client_auths client_auths_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: client_auths client_auths_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.client_auths @@ -1633,7 +1203,7 @@ ALTER TABLE ONLY public.client_auths -- --- Name: commentflags commentflags_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: commentflags commentflags_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.commentflags @@ -1641,7 +1211,7 @@ ALTER TABLE ONLY public.commentflags -- --- Name: comments comments_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: comments comments_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.comments @@ -1649,7 +1219,7 @@ ALTER TABLE ONLY public.comments -- --- Name: commentvotes commentvotes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: commentvotes commentvotes_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.commentvotes @@ -1657,7 +1227,7 @@ ALTER TABLE ONLY public.commentvotes -- --- Name: banneddomains domains_domain_key; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: banneddomains domains_domain_key; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.banneddomains @@ -1665,7 +1235,7 @@ ALTER TABLE ONLY public.banneddomains -- --- Name: banneddomains domains_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: banneddomains domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.banneddomains @@ -1673,7 +1243,7 @@ ALTER TABLE ONLY public.banneddomains -- --- Name: flags flags_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: flags flags_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.flags @@ -1681,7 +1251,7 @@ ALTER TABLE ONLY public.flags -- --- Name: follows follow_membership_unique; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: follows follow_membership_unique; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.follows @@ -1689,7 +1259,7 @@ ALTER TABLE ONLY public.follows -- --- Name: follows follows_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: follows follows_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.follows @@ -1697,15 +1267,7 @@ ALTER TABLE ONLY public.follows -- --- Name: subscriptions guild_membership_unique; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.subscriptions - ADD CONSTRAINT guild_membership_unique UNIQUE (user_id, board_id); - - --- --- Name: images images_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: images images_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.images @@ -1713,7 +1275,7 @@ ALTER TABLE ONLY public.images -- --- Name: modactions modactions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: modactions modactions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.modactions @@ -1721,7 +1283,7 @@ ALTER TABLE ONLY public.modactions -- --- Name: notifications notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: notifications notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.notifications @@ -1729,7 +1291,7 @@ ALTER TABLE ONLY public.notifications -- --- Name: oauth_apps oauth_apps_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: oauth_apps oauth_apps_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.oauth_apps @@ -1737,7 +1299,7 @@ ALTER TABLE ONLY public.oauth_apps -- --- Name: users one_discord_account; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: users one_discord_account; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.users @@ -1745,7 +1307,7 @@ ALTER TABLE ONLY public.users -- --- Name: notifications one_notif; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: notifications one_notif; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.notifications @@ -1753,7 +1315,7 @@ ALTER TABLE ONLY public.notifications -- --- Name: commentvotes onecvote; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: commentvotes onecvote; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.commentvotes @@ -1761,7 +1323,7 @@ ALTER TABLE ONLY public.commentvotes -- --- Name: votes onevote; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: votes onevote; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.votes @@ -1769,7 +1331,7 @@ ALTER TABLE ONLY public.votes -- --- Name: save_relationship save_constraint; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: save_relationship save_constraint; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.save_relationship @@ -1777,7 +1339,7 @@ ALTER TABLE ONLY public.save_relationship -- --- Name: save_relationship save_relationship_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: save_relationship save_relationship_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.save_relationship @@ -1785,7 +1347,7 @@ ALTER TABLE ONLY public.save_relationship -- --- Name: submissions submissions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: submissions submissions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.submissions @@ -1793,7 +1355,7 @@ ALTER TABLE ONLY public.submissions -- --- Name: subscriptions subscriptions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: subscriptions subscriptions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.subscriptions @@ -1801,7 +1363,7 @@ ALTER TABLE ONLY public.subscriptions -- --- Name: client_auths unique_access; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: client_auths unique_access; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.client_auths @@ -1809,7 +1371,7 @@ ALTER TABLE ONLY public.client_auths -- --- Name: oauth_apps unique_id; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: oauth_apps unique_id; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.oauth_apps @@ -1817,7 +1379,7 @@ ALTER TABLE ONLY public.oauth_apps -- --- Name: badges user_badge_constraint; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: badges user_badge_constraint; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.badges @@ -1825,7 +1387,7 @@ ALTER TABLE ONLY public.badges -- --- Name: userblocks userblocks_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: userblocks userblocks_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.userblocks @@ -1833,7 +1395,7 @@ ALTER TABLE ONLY public.userblocks -- --- Name: alts userpair; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: alts userpair; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.alts @@ -1841,7 +1403,7 @@ ALTER TABLE ONLY public.alts -- --- Name: users users_email_key; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: users users_email_key; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.users @@ -1849,7 +1411,7 @@ ALTER TABLE ONLY public.users -- --- Name: users users_original_username_key; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: users users_original_username_key; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.users @@ -1857,7 +1419,7 @@ ALTER TABLE ONLY public.users -- --- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.users @@ -1865,7 +1427,7 @@ ALTER TABLE ONLY public.users -- --- Name: users users_username_key; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: users users_username_key; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.users @@ -1873,7 +1435,7 @@ ALTER TABLE ONLY public.users -- --- Name: viewers viewers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: viewers viewers_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.viewers @@ -1881,7 +1443,7 @@ ALTER TABLE ONLY public.viewers -- --- Name: votes votes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- Name: votes votes_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.votes @@ -1889,518 +1451,462 @@ ALTER TABLE ONLY public.votes -- --- Name: alts_user1_idx; Type: INDEX; Schema: public; Owner: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- Name: award_user_idx; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX award_user_idx ON public.award_relationships USING btree (user_id); -- --- Name: badgedef_qual_idx; Type: INDEX; Schema: public; Owner: postgres +-- Name: badgedef_qual_idx; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX badgedef_qual_idx ON public.badge_defs USING btree (qualification_expr); -- --- Name: badges_badge_id_idx; Type: INDEX; Schema: public; Owner: postgres +-- 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: postgres +-- Name: badges_user_index; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX badges_user_index ON public.badges USING btree (user_id); -- --- Name: badlink_link_idx; Type: INDEX; Schema: public; Owner: postgres +-- Name: badlink_link_idx; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX badlink_link_idx ON public.badlinks USING btree (link); -- --- Name: badpic_phash_idx; Type: INDEX; Schema: public; Owner: postgres +-- Name: badpic_phash_idx; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX badpic_phash_idx ON public.badpics USING btree (phash); -- --- Name: badpic_phash_trgm_idx; Type: INDEX; Schema: public; Owner: postgres +-- Name: badpic_phash_trgm_idx; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX badpic_phash_trgm_idx ON public.badpics USING gin (phash public.gin_trgm_ops); -- --- Name: badpics_phash_index; Type: INDEX; Schema: public; Owner: postgres +-- Name: badpics_phash_index; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX badpics_phash_index ON public.badpics USING gin (phash public.gin_trgm_ops); -- --- Name: block_target_idx; Type: INDEX; Schema: public; Owner: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- Name: follow_user_id_index; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX follow_user_id_index ON public.follows USING btree (user_id); -- --- Name: modaction_action_idx; Type: INDEX; Schema: public; Owner: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- Name: modaction_pid_idx; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX modaction_pid_idx ON public.modactions USING btree (target_submission_id); -- --- Name: notification_read_idx; Type: INDEX; Schema: public; Owner: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- Name: post_author_index; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX post_author_index ON public.submissions USING btree (author_id); -- --- Name: post_offensive_index; Type: INDEX; Schema: public; Owner: postgres --- - -CREATE INDEX post_offensive_index ON public.submissions USING btree (is_offensive); - - --- --- Name: post_public_idx; Type: INDEX; Schema: public; Owner: postgres --- - -CREATE INDEX post_public_idx ON public.submissions USING btree (post_public); - - --- --- Name: sub_user_index; Type: INDEX; Schema: public; Owner: postgres +-- 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: postgres +-- 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_best_only_idx; Type: INDEX; Schema: public; Owner: postgres --- - -CREATE INDEX submission_best_only_idx ON public.submissions USING btree (score_best DESC); - - --- --- Name: submission_disputed_sort_idx; Type: INDEX; Schema: public; Owner: postgres --- - -CREATE INDEX submission_disputed_sort_idx ON public.submissions USING btree (is_banned, deleted_utc, score_disputed DESC, over_18); - - --- --- Name: submission_domainref_index; Type: INDEX; Schema: public; Owner: postgres +-- Name: submission_domainref_index; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX submission_domainref_index ON public.submissions USING btree (domain_ref); -- --- Name: submission_hot_sort_idx; Type: INDEX; Schema: public; Owner: postgres --- - -CREATE INDEX submission_hot_sort_idx ON public.submissions USING btree (is_banned, deleted_utc, score_hot DESC, over_18); - - --- --- Name: submission_isbanned_idx; Type: INDEX; Schema: public; Owner: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- Name: submission_pinned_idx; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX submission_pinned_idx ON public.submissions USING btree (is_pinned); -- --- Name: submission_purge_idx; Type: INDEX; Schema: public; Owner: postgres --- - -CREATE INDEX submission_purge_idx ON public.submissions USING btree (purged_utc); - - --- --- Name: submissions_author_index; Type: INDEX; Schema: public; Owner: postgres +-- 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: postgres +-- 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_offensive_index; Type: INDEX; Schema: public; Owner: postgres --- - -CREATE INDEX submissions_offensive_index ON public.submissions USING btree (is_offensive); - - --- --- Name: submissions_over18_index; Type: INDEX; Schema: public; Owner: postgres +-- Name: submissions_over18_index; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX submissions_over18_index ON public.submissions USING btree (over_18); -- --- Name: submissions_score_idx; Type: INDEX; Schema: public; Owner: postgres --- - -CREATE INDEX submissions_score_idx ON public.submissions USING btree (score_top); - - --- --- Name: subscription_board_index; Type: INDEX; Schema: public; Owner: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- 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: postgres +-- Name: votes_type_index; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX votes_type_index ON public.votes USING btree (vote_type); -- --- Name: badges badges_badge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres +-- Name: badges badges_badge_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.badges @@ -2408,7 +1914,7 @@ ALTER TABLE ONLY public.badges -- --- Name: commentflags commentflags_comment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres +-- Name: commentflags commentflags_comment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.commentflags @@ -2416,7 +1922,7 @@ ALTER TABLE ONLY public.commentflags -- --- Name: flags flags_post_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres +-- Name: flags flags_post_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.flags @@ -2424,7 +1930,7 @@ ALTER TABLE ONLY public.flags -- --- Name: notifications notifications_comment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres +-- Name: notifications notifications_comment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.notifications @@ -2432,10 +1938,10 @@ ALTER TABLE ONLY public.notifications -- --- Name: SCHEMA public; Type: ACL; Schema: -; Owner: postgres +-- Name: FUNCTION pg_stat_statements_reset(userid oid, dbid oid, queryid bigint); Type: ACL; Schema: public; Owner: - -- -GRANT ALL ON SCHEMA public TO PUBLIC; +GRANT ALL ON FUNCTION public.pg_stat_statements_reset(userid oid, dbid oid, queryid bigint) TO doadmin WITH GRANT OPTION; --