\restrict 4lxRvJkzFIK9U8uHyPKo1Wk4GuY4dImiyyJ2gX1hSlDMJnP2Tr19b1knRB5ODwJ

-- Dumped from database version 17.6 (Debian 17.6-1.pgdg13+1)
-- Dumped by pg_dump version 17.6 (Debian 17.6-1.pgdg12+1)

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET transaction_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_prewarm; Type: EXTENSION; Schema: -; Owner: -
--

CREATE EXTENSION IF NOT EXISTS pg_prewarm WITH SCHEMA public;


--
-- Name: EXTENSION pg_prewarm; Type: COMMENT; Schema: -; Owner: -
--

COMMENT ON EXTENSION pg_prewarm IS 'prewarm relation data';


--
-- 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';


--
-- Name: pgcrypto; Type: EXTENSION; Schema: -; Owner: -
--

CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA public;


--
-- Name: EXTENSION pgcrypto; Type: COMMENT; Schema: -; Owner: -
--

COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions';


--
-- Name: vector; Type: EXTENSION; Schema: -; Owner: -
--

CREATE EXTENSION IF NOT EXISTS vector WITH SCHEMA public;


--
-- Name: EXTENSION vector; Type: COMMENT; Schema: -; Owner: -
--

COMMENT ON EXTENSION vector IS 'vector data type and ivfflat access method';


--
-- Name: domain_post_file_type; Type: TYPE; Schema: public; Owner: -
--

CREATE TYPE public.domain_post_file_type AS ENUM (
    'Domain::PostFile',
    'Domain::PostFile::InkbunnyPostFile',
    'Domain::PostFile::BlueskyPostFile'
);


--
-- Name: domain_post_group_join_type; Type: TYPE; Schema: public; Owner: -
--

CREATE TYPE public.domain_post_group_join_type AS ENUM (
    'Domain::PostGroupJoin::InkbunnyPoolJoin',
    'Domain::PostGroupJoin::E621PoolJoin',
    'Domain::PostGroupJoin::SofurryFolderJoin'
);


--
-- Name: domain_post_group_type; Type: TYPE; Schema: public; Owner: -
--

CREATE TYPE public.domain_post_group_type AS ENUM (
    'Domain::PostGroup::InkbunnyPool',
    'Domain::PostGroup::E621Pool',
    'Domain::PostGroup::SofurryFolder'
);


--
-- Name: domain_post_type; Type: TYPE; Schema: public; Owner: -
--

CREATE TYPE public.domain_post_type AS ENUM (
    'Domain::Post::FaPost',
    'Domain::Post::E621Post',
    'Domain::Post::InkbunnyPost',
    'Domain::Post::SofurryPost',
    'Domain::Post::WeasylPost',
    'Domain::Post::BlueskyPost'
);


--
-- Name: domain_user_post_fav_type; Type: TYPE; Schema: public; Owner: -
--

CREATE TYPE public.domain_user_post_fav_type AS ENUM (
    'Domain::UserPostFav',
    'Domain::UserPostFav::FaUserPostFav_INVALID'
);


--
-- Name: domain_user_type; Type: TYPE; Schema: public; Owner: -
--

CREATE TYPE public.domain_user_type AS ENUM (
    'Domain::User::FaUser',
    'Domain::User::E621User',
    'Domain::User::InkbunnyUser',
    'Domain::User::SofurryUser',
    'Domain::User::WeasylUser',
    'Domain::User::BlueskyUser'
);


--
-- Name: postable_type; Type: TYPE; Schema: public; Owner: -
--

CREATE TYPE public.postable_type AS ENUM (
    'Domain::Fa::Post',
    'Domain::E621::Post',
    'Domain::Inkbunny::Post'
);


SET default_tablespace = '';

SET default_table_access_method = heap;

--
-- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.ar_internal_metadata (
    key character varying NOT NULL,
    value character varying,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
)
PARTITION BY HASH (sha256);


--
-- Name: blob_files_00; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_00 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_01; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_01 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_02; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_02 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_03; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_03 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_04; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_04 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_05; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_05 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_06; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_06 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_07; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_07 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_08; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_08 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_09; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_09 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_10; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_10 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_11; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_11 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_12; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_12 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_13; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_13 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_14; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_14 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_15; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_15 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_16; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_16 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_17; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_17 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_18; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_18 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_19; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_19 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_20; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_20 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_21; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_21 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_22; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_22 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_23; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_23 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_24; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_24 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_25; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_25 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_26; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_26 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_27; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_27 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_28; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_28 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_29; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_29 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_30; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_30 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_31; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_31 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_32; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_32 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_33; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_33 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_34; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_34 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_35; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_35 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_36; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_36 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_37; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_37 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_38; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_38 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_39; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_39 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_40; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_40 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_41; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_41 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_42; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_42 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_43; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_43 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_44; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_44 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_45; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_45 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_46; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_46 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_47; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_47 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_48; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_48 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_49; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_49 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_50; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_50 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_51; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_51 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_52; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_52 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_53; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_53 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_54; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_54 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_55; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_55 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_56; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_56 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_57; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_57 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_58; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_58 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_59; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_59 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_60; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_60 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_61; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_61 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_62; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_62 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: blob_files_63; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blob_files_63 (
    sha256 bytea NOT NULL,
    version integer NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    content_type character varying NOT NULL,
    size_bytes integer NOT NULL,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: domain_bluesky_monitored_objects; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_bluesky_monitored_objects (
    id bigint NOT NULL,
    value character varying NOT NULL,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL,
    kind integer DEFAULT 0 NOT NULL
);


--
-- Name: domain_bluesky_monitored_objects_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_bluesky_monitored_objects_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_bluesky_monitored_objects_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_bluesky_monitored_objects_id_seq OWNED BY public.domain_bluesky_monitored_objects.id;


--
-- Name: domain_fa_fav_id_and_dates; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_fa_fav_id_and_dates (
    id bigint NOT NULL,
    user_id bigint NOT NULL,
    post_fa_id integer,
    fav_fa_id integer,
    date timestamp(6) without time zone,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL
);


--
-- Name: domain_fa_fav_id_and_dates_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_fa_fav_id_and_dates_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_fa_fav_id_and_dates_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_fa_fav_id_and_dates_id_seq OWNED BY public.domain_fa_fav_id_and_dates.id;


--
-- Name: domain_post_file_bit_fingerprints; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_post_file_bit_fingerprints (
    id bigint NOT NULL,
    post_file_id bigint NOT NULL,
    thumbnail_id bigint NOT NULL,
    fingerprint_value bit(256),
    fingerprint_detail_value bit(1024),
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL
);


--
-- Name: domain_post_file_bit_fingerprints_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_post_file_bit_fingerprints_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_post_file_bit_fingerprints_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_post_file_bit_fingerprints_id_seq OWNED BY public.domain_post_file_bit_fingerprints.id;


--
-- Name: domain_post_file_thumbnails; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_post_file_thumbnails (
    id bigint NOT NULL,
    post_file_id bigint NOT NULL,
    thumb_type integer NOT NULL,
    frame integer DEFAULT 0 NOT NULL,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL
);


--
-- Name: domain_post_file_thumbnails_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_post_file_thumbnails_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_post_file_thumbnails_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_post_file_thumbnails_id_seq OWNED BY public.domain_post_file_thumbnails.id;


--
-- Name: domain_post_files; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_post_files (
    id bigint NOT NULL,
    type public.domain_post_file_type NOT NULL,
    post_id bigint NOT NULL,
    log_entry_id bigint,
    blob_sha256 bytea,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL,
    state character varying NOT NULL,
    url_str character varying,
    error_message character varying,
    last_status_code integer,
    retry_count integer DEFAULT 0
);


--
-- Name: domain_post_files_bluesky_aux; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_post_files_bluesky_aux (
    base_table_id bigint NOT NULL,
    file_order integer NOT NULL,
    alt_text text,
    aspect_ratio_width integer,
    aspect_ratio_height integer,
    blob_ref character varying
);


--
-- Name: domain_post_files_bluesky_aux_base_table_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_post_files_bluesky_aux_base_table_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_post_files_bluesky_aux_base_table_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_post_files_bluesky_aux_base_table_id_seq OWNED BY public.domain_post_files_bluesky_aux.base_table_id;


--
-- Name: domain_post_files_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_post_files_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_post_files_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_post_files_id_seq OWNED BY public.domain_post_files.id;


--
-- Name: domain_post_files_inkbunny_aux; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_post_files_inkbunny_aux (
    base_table_id bigint NOT NULL,
    ib_id integer,
    ib_detail_raw jsonb DEFAULT '{}'::jsonb,
    file_order integer,
    ib_created_at timestamp(6) without time zone,
    file_name character varying,
    md5_initial character varying,
    md5_full character varying,
    md5s jsonb DEFAULT '[]'::jsonb
);


--
-- Name: domain_post_files_inkbunny_aux_base_table_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_post_files_inkbunny_aux_base_table_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_post_files_inkbunny_aux_base_table_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_post_files_inkbunny_aux_base_table_id_seq OWNED BY public.domain_post_files_inkbunny_aux.base_table_id;


--
-- Name: domain_post_group_joins; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_post_group_joins (
    type public.domain_post_group_join_type NOT NULL,
    post_id bigint NOT NULL,
    group_id bigint NOT NULL,
    json_attributes jsonb DEFAULT '{}'::jsonb,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL
);


--
-- Name: domain_post_groups; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_post_groups (
    id bigint NOT NULL,
    type public.domain_post_group_type NOT NULL,
    json_attributes jsonb DEFAULT '{}'::jsonb,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL
);


--
-- Name: domain_post_groups_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_post_groups_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_post_groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_post_groups_id_seq OWNED BY public.domain_post_groups.id;


--
-- Name: domain_posts; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_posts (
    id bigint NOT NULL,
    type public.domain_post_type NOT NULL,
    posted_at timestamp without time zone,
    json_attributes jsonb DEFAULT '{}'::jsonb,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL
);


--
-- Name: domain_posts_bluesky_aux; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_posts_bluesky_aux (
    base_table_id bigint NOT NULL,
    at_uri character varying,
    state character varying NOT NULL,
    rkey character varying NOT NULL,
    text text,
    language character varying,
    like_count integer,
    repost_count integer,
    reply_count integer,
    quote_count integer,
    hashtags jsonb DEFAULT '[]'::jsonb,
    mentions jsonb DEFAULT '[]'::jsonb,
    links jsonb DEFAULT '[]'::jsonb,
    reply_to_uri character varying,
    quote_uri character varying,
    post_raw jsonb DEFAULT '{}'::jsonb,
    first_seen_entry_id bigint,
    scan_error character varying,
    monitor_scanned_at timestamp(6) without time zone
);


--
-- Name: domain_posts_bluesky_aux_base_table_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_posts_bluesky_aux_base_table_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_posts_bluesky_aux_base_table_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_posts_bluesky_aux_base_table_id_seq OWNED BY public.domain_posts_bluesky_aux.base_table_id;


--
-- Name: domain_posts_e621_aux; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_posts_e621_aux (
    base_table_id bigint NOT NULL,
    state character varying NOT NULL,
    e621_id integer NOT NULL,
    scanned_post_favs_at timestamp without time zone,
    rating character varying,
    tags_array jsonb,
    flags_array jsonb,
    pools_array jsonb,
    sources_array jsonb,
    artists_array jsonb,
    e621_updated_at timestamp without time zone,
    parent_post_e621_id integer,
    last_index_page_id bigint,
    caused_by_entry_id bigint,
    scan_log_entry_id bigint,
    index_page_ids jsonb,
    description character varying,
    score integer,
    score_up integer,
    score_down integer,
    num_favorites integer,
    num_comments integer,
    change_seq integer,
    md5 character varying,
    prev_md5s jsonb,
    scan_error character varying,
    uploader_user_id bigint
);


--
-- Name: domain_posts_e621_aux_base_table_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_posts_e621_aux_base_table_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_posts_e621_aux_base_table_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_posts_e621_aux_base_table_id_seq OWNED BY public.domain_posts_e621_aux.base_table_id;


--
-- Name: domain_posts_fa_aux; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_posts_fa_aux (
    base_table_id bigint NOT NULL,
    state character varying,
    title character varying,
    fa_id integer,
    category character varying,
    theme character varying,
    species character varying,
    gender character varying,
    description character varying,
    keywords jsonb DEFAULT '[]'::jsonb,
    num_favorites integer,
    num_comments integer,
    num_views integer,
    scanned_at timestamp without time zone,
    scan_file_error character varying,
    last_user_page_id integer,
    first_browse_page_id integer,
    first_gallery_page_id integer,
    first_seen_entry_id integer,
    fuzzysearch_checked_at timestamp without time zone,
    fuzzysearch_json jsonb,
    fuzzysearch_entry_id integer,
    tried_from_fur_archiver boolean DEFAULT false,
    tried_from_tor boolean DEFAULT false
);


--
-- Name: domain_posts_fa_aux_base_table_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_posts_fa_aux_base_table_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_posts_fa_aux_base_table_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_posts_fa_aux_base_table_id_seq OWNED BY public.domain_posts_fa_aux.base_table_id;


--
-- Name: domain_posts_ib_aux; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_posts_ib_aux (
    base_table_id bigint NOT NULL,
    ib_id integer,
    state character varying,
    rating character varying,
    submission_type character varying,
    title character varying,
    writing character varying,
    description character varying,
    num_views integer,
    num_files integer,
    num_favs integer,
    num_comments integer,
    keywords jsonb DEFAULT '[]'::jsonb,
    last_file_updated_at timestamp without time zone,
    deep_update_log_entry_id bigint,
    shallow_update_log_entry_id bigint,
    shallow_updated_at timestamp without time zone,
    deep_updated_at timestamp without time zone,
    ib_detail_raw jsonb
);


--
-- Name: domain_posts_ib_aux_base_table_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_posts_ib_aux_base_table_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_posts_ib_aux_base_table_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_posts_ib_aux_base_table_id_seq OWNED BY public.domain_posts_ib_aux.base_table_id;


--
-- Name: domain_posts_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_posts_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_posts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_posts_id_seq OWNED BY public.domain_posts.id;


--
-- Name: domain_twitter_medias; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_twitter_medias (
    id character varying NOT NULL,
    state integer,
    state_detail json,
    raw_data json,
    url_str character varying,
    tweet_id bigint NOT NULL,
    file_id bigint,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL
);


--
-- Name: domain_twitter_tweets; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_twitter_tweets (
    id bigint NOT NULL,
    state integer,
    state_detail json,
    raw_data json,
    author_id bigint,
    content character varying,
    reply_to_tweet_id bigint,
    tweeted_at timestamp without time zone,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL
);


--
-- Name: domain_twitter_tweets_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_twitter_tweets_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_twitter_tweets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_twitter_tweets_id_seq OWNED BY public.domain_twitter_tweets.id;


--
-- Name: domain_twitter_user_versions; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_twitter_user_versions (
    id bigint NOT NULL,
    item_id bigint,
    schema_version integer,
    event character varying NOT NULL,
    diff jsonb,
    created_at timestamp(6) without time zone NOT NULL
);


--
-- Name: domain_twitter_user_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_twitter_user_versions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_twitter_user_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_twitter_user_versions_id_seq OWNED BY public.domain_twitter_user_versions.id;


--
-- Name: domain_twitter_users; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_twitter_users (
    id bigint NOT NULL,
    state integer,
    state_detail json,
    raw_data json,
    name character varying NOT NULL,
    nick character varying,
    description character varying,
    num_fav_count integer,
    num_followers integer,
    num_following integer,
    registered_at timestamp(6) without time zone,
    scanned_timeline_at timestamp(6) without time zone,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL,
    tw_id bigint
);


--
-- Name: domain_twitter_users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_twitter_users_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_twitter_users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_twitter_users_id_seq OWNED BY public.domain_twitter_users.id;


--
-- Name: domain_user_avatars; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_user_avatars (
    id bigint NOT NULL,
    user_id bigint NOT NULL,
    json_attributes jsonb DEFAULT '{}'::jsonb,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL
);


--
-- Name: domain_user_avatars_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_user_avatars_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_user_avatars_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_user_avatars_id_seq OWNED BY public.domain_user_avatars.id;


--
-- Name: domain_user_job_event_add_tracked_objects; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_user_job_event_add_tracked_objects (
    id bigint NOT NULL,
    kind integer NOT NULL,
    num_added integer NOT NULL,
    num_total integer NOT NULL,
    duration_since_last_scan interval,
    user_id bigint NOT NULL,
    log_entry_id bigint,
    json_attributes jsonb DEFAULT '{}'::jsonb,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL
);


--
-- Name: domain_user_job_event_add_tracked_objects_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_user_job_event_add_tracked_objects_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_user_job_event_add_tracked_objects_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_user_job_event_add_tracked_objects_id_seq OWNED BY public.domain_user_job_event_add_tracked_objects.id;


--
-- Name: domain_user_job_event_follow_scans; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_user_job_event_follow_scans (
    id bigint NOT NULL,
    kind character varying NOT NULL,
    state character varying DEFAULT 'running'::character varying NOT NULL,
    started_at timestamp(6) without time zone NOT NULL,
    completed_at timestamp(6) without time zone,
    user_id bigint NOT NULL,
    log_entry_id bigint,
    json_attributes jsonb DEFAULT '{}'::jsonb NOT NULL,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL
);


--
-- Name: domain_user_job_event_follow_scans_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_user_job_event_follow_scans_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_user_job_event_follow_scans_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_user_job_event_follow_scans_id_seq OWNED BY public.domain_user_job_event_follow_scans.id;


--
-- Name: domain_user_job_event_posts_scans; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_user_job_event_posts_scans (
    id bigint NOT NULL,
    user_id bigint NOT NULL,
    log_entry_id bigint,
    json_attributes jsonb DEFAULT '{}'::jsonb NOT NULL,
    total_posts_seen integer,
    new_posts_seen integer,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL
);


--
-- Name: domain_user_job_event_posts_scans_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_user_job_event_posts_scans_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_user_job_event_posts_scans_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_user_job_event_posts_scans_id_seq OWNED BY public.domain_user_job_event_posts_scans.id;


--
-- Name: domain_user_job_event_profile_scans; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_user_job_event_profile_scans (
    id bigint NOT NULL,
    user_id bigint NOT NULL,
    log_entry_id bigint,
    json_attributes jsonb DEFAULT '{}'::jsonb NOT NULL,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL
);


--
-- Name: domain_user_job_event_profile_scans_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_user_job_event_profile_scans_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_user_job_event_profile_scans_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_user_job_event_profile_scans_id_seq OWNED BY public.domain_user_job_event_profile_scans.id;


--
-- Name: domain_user_post_creations; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_user_post_creations (
    user_id bigint NOT NULL,
    post_id bigint NOT NULL
);


--
-- Name: domain_user_post_fav_post_factors; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_user_post_fav_post_factors (
    post_id bigint,
    embedding public.vector(32)
);


--
-- Name: domain_user_post_fav_user_factors; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_user_post_fav_user_factors (
    user_id bigint,
    embedding public.vector(32)
);


--
-- Name: domain_user_post_favs; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_user_post_favs (
    user_id bigint NOT NULL,
    post_id bigint NOT NULL,
    removed boolean DEFAULT false NOT NULL,
    type public.domain_user_post_fav_type DEFAULT 'Domain::UserPostFav'::public.domain_user_post_fav_type NOT NULL,
    json_attributes jsonb DEFAULT '{}'::jsonb
)
WITH (autovacuum_enabled='true');


--
-- Name: domain_user_post_favs_e621; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_user_post_favs_e621 (
    user_id bigint NOT NULL,
    post_id bigint NOT NULL,
    removed boolean DEFAULT false NOT NULL,
    explicit_time timestamp(6) without time zone,
    inferred_time timestamp(6) without time zone
);


--
-- Name: domain_user_post_favs_fa; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_user_post_favs_fa (
    user_id bigint NOT NULL,
    post_id bigint NOT NULL,
    fa_fav_id integer,
    removed boolean DEFAULT false NOT NULL,
    explicit_time timestamp(6) without time zone,
    inferred_time timestamp(6) without time zone
);


--
-- Name: domain_user_search_names; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_user_search_names (
    id bigint NOT NULL,
    user_id bigint NOT NULL,
    name character varying NOT NULL,
    dmetaphone_primary character varying GENERATED ALWAYS AS (public.dmetaphone((name)::text)) STORED,
    dmetaphone_alt character varying GENERATED ALWAYS AS (public.dmetaphone_alt((name)::text)) STORED
);


--
-- Name: domain_user_search_names_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_user_search_names_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_user_search_names_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_user_search_names_id_seq OWNED BY public.domain_user_search_names.id;


--
-- Name: domain_user_user_follow_from_factors; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_user_user_follow_from_factors (
    user_id bigint,
    embedding public.vector(32)
);


--
-- Name: domain_user_user_follow_to_factors; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_user_user_follow_to_factors (
    user_id bigint,
    embedding public.vector(32)
);


--
-- Name: domain_user_user_follows; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_user_user_follows (
    from_id bigint NOT NULL,
    to_id bigint NOT NULL,
    removed_at timestamp(6) without time zone,
    followed_at timestamp(6) without time zone
);


--
-- Name: domain_users; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_users (
    id bigint NOT NULL,
    type public.domain_user_type NOT NULL,
    json_attributes jsonb DEFAULT '{}'::jsonb,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL,
    user_post_creations_count integer,
    user_post_favs_count integer,
    user_user_follows_from_count integer,
    user_user_follows_to_count integer
);


--
-- Name: domain_users_bluesky_aux; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_users_bluesky_aux (
    base_table_id bigint NOT NULL,
    state character varying NOT NULL,
    did character varying NOT NULL,
    handle character varying NOT NULL,
    display_name character varying,
    description text,
    followers_count integer,
    following_count integer,
    posts_count integer,
    scanned_profile_at timestamp(6) without time zone,
    scanned_posts_at timestamp(6) without time zone,
    profile_raw jsonb DEFAULT '{}'::jsonb,
    last_scan_log_entry_id bigint,
    last_posts_scan_log_entry_id bigint,
    registered_at timestamp(6) without time zone
);


--
-- Name: domain_users_bluesky_aux_base_table_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_users_bluesky_aux_base_table_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_users_bluesky_aux_base_table_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_users_bluesky_aux_base_table_id_seq OWNED BY public.domain_users_bluesky_aux.base_table_id;


--
-- Name: domain_users_e621_aux; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_users_e621_aux (
    base_table_id bigint NOT NULL,
    e621_id integer NOT NULL,
    name character varying NOT NULL,
    favs_are_hidden boolean,
    num_other_favs_cached integer,
    scanned_favs_status character varying,
    registered_at timestamp(6) without time zone
);


--
-- Name: domain_users_e621_aux_base_table_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_users_e621_aux_base_table_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_users_e621_aux_base_table_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_users_e621_aux_base_table_id_seq OWNED BY public.domain_users_e621_aux.base_table_id;


--
-- Name: domain_users_fa_aux; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_users_fa_aux (
    base_table_id bigint NOT NULL,
    state character varying,
    name character varying,
    url_name character varying,
    full_name character varying,
    account_status character varying,
    artist_type character varying,
    mood character varying,
    profile_html character varying,
    num_pageviews integer,
    num_submissions integer,
    num_comments_recieved integer,
    num_comments_given integer,
    num_journals integer,
    num_favorites integer,
    num_watched_by integer,
    num_watching integer,
    scanned_gallery_at timestamp(6) without time zone,
    scanned_page_at timestamp(6) without time zone,
    scanned_follows_at timestamp(6) without time zone,
    scanned_followed_by_at timestamp(6) without time zone,
    scanned_incremental_at timestamp(6) without time zone,
    registered_at timestamp(6) without time zone,
    migrated_followed_users_at timestamp(6) without time zone,
    last_user_page_id bigint,
    last_gallery_page_id bigint,
    page_scan_error character varying,
    is_disabled boolean
);


--
-- Name: domain_users_fa_aux_base_table_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_users_fa_aux_base_table_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_users_fa_aux_base_table_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_users_fa_aux_base_table_id_seq OWNED BY public.domain_users_fa_aux.base_table_id;


--
-- Name: domain_users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_users_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_users_id_seq OWNED BY public.domain_users.id;


--
-- Name: domain_users_inkbunny_aux; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.domain_users_inkbunny_aux (
    base_table_id bigint NOT NULL,
    ib_id integer NOT NULL,
    name character varying NOT NULL,
    state character varying NOT NULL,
    scanned_gallery_at timestamp without time zone,
    deep_update_log_entry_id bigint,
    shallow_update_log_entry_id bigint,
    ib_detail_raw jsonb DEFAULT '{}'::jsonb
);


--
-- Name: domain_users_inkbunny_aux_base_table_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.domain_users_inkbunny_aux_base_table_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: domain_users_inkbunny_aux_base_table_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.domain_users_inkbunny_aux_base_table_id_seq OWNED BY public.domain_users_inkbunny_aux.base_table_id;


--
-- Name: global_states; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.global_states (
    id bigint NOT NULL,
    key character varying NOT NULL,
    value character varying,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL,
    value_type integer DEFAULT 0 NOT NULL
);


--
-- Name: global_states_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.global_states_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: global_states_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.global_states_id_seq OWNED BY public.global_states.id;


--
-- Name: good_job_batches; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.good_job_batches (
    id uuid DEFAULT gen_random_uuid() NOT NULL,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL,
    description text,
    serialized_properties jsonb,
    on_finish text,
    on_success text,
    on_discard text,
    callback_queue_name text,
    callback_priority integer,
    enqueued_at timestamp(6) without time zone,
    discarded_at timestamp(6) without time zone,
    finished_at timestamp(6) without time zone
);


--
-- Name: good_job_execution_log_lines_collections; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.good_job_execution_log_lines_collections (
    id bigint NOT NULL,
    good_job_execution_id uuid NOT NULL,
    log_lines jsonb,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL
);


--
-- Name: good_job_execution_log_lines_collections_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.good_job_execution_log_lines_collections_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: good_job_execution_log_lines_collections_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.good_job_execution_log_lines_collections_id_seq OWNED BY public.good_job_execution_log_lines_collections.id;


--
-- Name: good_job_executions; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.good_job_executions (
    id uuid DEFAULT gen_random_uuid() NOT NULL,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL,
    active_job_id uuid NOT NULL,
    job_class text,
    queue_name text,
    serialized_params jsonb,
    scheduled_at timestamp(6) without time zone,
    finished_at timestamp(6) without time zone,
    error text,
    error_event smallint,
    error_backtrace text[],
    process_id uuid,
    duration interval
);


--
-- Name: good_job_processes; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.good_job_processes (
    id uuid DEFAULT gen_random_uuid() NOT NULL,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL,
    state jsonb,
    lock_type smallint
);


--
-- Name: good_job_settings; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.good_job_settings (
    id uuid DEFAULT gen_random_uuid() NOT NULL,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL,
    key text,
    value jsonb
);


--
-- Name: good_jobs; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.good_jobs (
    id uuid DEFAULT gen_random_uuid() NOT NULL,
    queue_name text,
    priority integer,
    serialized_params jsonb,
    scheduled_at timestamp(6) without time zone,
    performed_at timestamp(6) without time zone,
    finished_at timestamp(6) without time zone,
    error text,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL,
    active_job_id uuid,
    concurrency_key text,
    cron_key text,
    retried_good_job_id uuid,
    cron_at timestamp(6) without time zone,
    batch_id uuid,
    batch_callback_id uuid,
    is_discrete boolean,
    executions_count integer,
    job_class text,
    error_event smallint,
    labels text[],
    locked_by_id uuid,
    locked_at timestamp(6) without time zone
);


--
-- Name: http_log_entries; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.http_log_entries (
    id bigint NOT NULL,
    uri_scheme character varying NOT NULL,
    uri_host character varying NOT NULL,
    uri_path character varying NOT NULL,
    uri_query character varying,
    uri_hash character varying,
    verb integer NOT NULL,
    request_headers_id bigint NOT NULL,
    response_headers_id bigint NOT NULL,
    status_code integer NOT NULL,
    response_time_ms integer NOT NULL,
    content_type character varying NOT NULL,
    response_sha256 bytea NOT NULL,
    requested_at timestamp(6) without time zone NOT NULL,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL,
    caused_by_id bigint,
    performed_by integer NOT NULL
);


--
-- Name: http_log_entries_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.http_log_entries_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: http_log_entries_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.http_log_entries_id_seq OWNED BY public.http_log_entries.id;


--
-- Name: http_log_entry_headers; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.http_log_entry_headers (
    id bigint NOT NULL,
    sha256 bytea NOT NULL,
    headers jsonb NOT NULL,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL
);


--
-- Name: http_log_entry_headers_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.http_log_entry_headers_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: http_log_entry_headers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.http_log_entry_headers_id_seq OWNED BY public.http_log_entry_headers.id;


--
-- Name: ip_address_roles; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.ip_address_roles (
    id bigint NOT NULL,
    ip_address inet NOT NULL,
    role character varying DEFAULT 'user'::character varying NOT NULL,
    description character varying,
    active boolean DEFAULT true NOT NULL,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL
);


--
-- Name: ip_address_roles_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.ip_address_roles_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: ip_address_roles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.ip_address_roles_id_seq OWNED BY public.ip_address_roles.id;


--
-- Name: pghero_query_stats; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.pghero_query_stats (
    id bigint NOT NULL,
    database text,
    "user" text,
    query text,
    query_hash bigint,
    total_time double precision,
    calls bigint,
    captured_at timestamp without time zone
);


--
-- Name: pghero_query_stats_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.pghero_query_stats_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: pghero_query_stats_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.pghero_query_stats_id_seq OWNED BY public.pghero_query_stats.id;


--
-- Name: pghero_space_stats; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.pghero_space_stats (
    id bigint NOT NULL,
    database text,
    schema text,
    relation text,
    size bigint,
    captured_at timestamp without time zone
);


--
-- Name: pghero_space_stats_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.pghero_space_stats_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: pghero_space_stats_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.pghero_space_stats_id_seq OWNED BY public.pghero_space_stats.id;


--
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.schema_migrations (
    version character varying NOT NULL
);


--
-- Name: telegram_bot_logs; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.telegram_bot_logs (
    id bigint NOT NULL,
    telegram_user_id bigint NOT NULL,
    telegram_username character varying,
    telegram_first_name character varying,
    telegram_last_name character varying,
    telegram_chat_id bigint NOT NULL,
    request_timestamp timestamp without time zone NOT NULL,
    status character varying NOT NULL,
    error_message text,
    fingerprint_computation_time double precision,
    search_computation_time double precision,
    search_results_count integer DEFAULT 0,
    response_data jsonb DEFAULT '{}'::jsonb,
    processed_image_sha256 bytea,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL,
    download_time double precision,
    image_processing_time double precision,
    total_request_time double precision
);


--
-- Name: telegram_bot_logs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.telegram_bot_logs_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: telegram_bot_logs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.telegram_bot_logs_id_seq OWNED BY public.telegram_bot_logs.id;


--
-- Name: trained_regression_models; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.trained_regression_models (
    id bigint NOT NULL,
    name character varying NOT NULL,
    description text,
    model_type character varying NOT NULL,
    total_records_count integer NOT NULL,
    training_records_count integer NOT NULL,
    evaluation_records_count integer NOT NULL,
    train_test_split_ratio double precision DEFAULT 0.8 NOT NULL,
    random_seed integer DEFAULT 42 NOT NULL,
    max_points_limit integer,
    x_min double precision NOT NULL,
    x_max double precision NOT NULL,
    y_min double precision NOT NULL,
    y_max double precision NOT NULL,
    coefficients jsonb DEFAULT '[]'::jsonb NOT NULL,
    training_r_squared double precision NOT NULL,
    evaluation_r_squared double precision NOT NULL,
    equation_string text NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL
);


--
-- Name: trained_regression_models_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.trained_regression_models_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: trained_regression_models_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.trained_regression_models_id_seq OWNED BY public.trained_regression_models.id;


--
-- Name: users; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.users (
    id bigint NOT NULL,
    email character varying DEFAULT ''::character varying NOT NULL,
    encrypted_password character varying DEFAULT ''::character varying NOT NULL,
    reset_password_token character varying,
    reset_password_sent_at timestamp(6) without time zone,
    remember_created_at timestamp(6) without time zone,
    sign_in_count integer DEFAULT 0 NOT NULL,
    current_sign_in_at timestamp(6) without time zone,
    last_sign_in_at timestamp(6) without time zone,
    current_sign_in_ip character varying,
    last_sign_in_ip character varying,
    role character varying,
    created_at timestamp(6) without time zone NOT NULL,
    updated_at timestamp(6) without time zone NOT NULL
);


--
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.users_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;


--
-- Name: blob_files_00; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_00 FOR VALUES WITH (modulus 64, remainder 0);


--
-- Name: blob_files_01; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_01 FOR VALUES WITH (modulus 64, remainder 1);


--
-- Name: blob_files_02; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_02 FOR VALUES WITH (modulus 64, remainder 2);


--
-- Name: blob_files_03; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_03 FOR VALUES WITH (modulus 64, remainder 3);


--
-- Name: blob_files_04; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_04 FOR VALUES WITH (modulus 64, remainder 4);


--
-- Name: blob_files_05; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_05 FOR VALUES WITH (modulus 64, remainder 5);


--
-- Name: blob_files_06; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_06 FOR VALUES WITH (modulus 64, remainder 6);


--
-- Name: blob_files_07; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_07 FOR VALUES WITH (modulus 64, remainder 7);


--
-- Name: blob_files_08; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_08 FOR VALUES WITH (modulus 64, remainder 8);


--
-- Name: blob_files_09; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_09 FOR VALUES WITH (modulus 64, remainder 9);


--
-- Name: blob_files_10; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_10 FOR VALUES WITH (modulus 64, remainder 10);


--
-- Name: blob_files_11; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_11 FOR VALUES WITH (modulus 64, remainder 11);


--
-- Name: blob_files_12; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_12 FOR VALUES WITH (modulus 64, remainder 12);


--
-- Name: blob_files_13; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_13 FOR VALUES WITH (modulus 64, remainder 13);


--
-- Name: blob_files_14; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_14 FOR VALUES WITH (modulus 64, remainder 14);


--
-- Name: blob_files_15; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_15 FOR VALUES WITH (modulus 64, remainder 15);


--
-- Name: blob_files_16; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_16 FOR VALUES WITH (modulus 64, remainder 16);


--
-- Name: blob_files_17; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_17 FOR VALUES WITH (modulus 64, remainder 17);


--
-- Name: blob_files_18; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_18 FOR VALUES WITH (modulus 64, remainder 18);


--
-- Name: blob_files_19; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_19 FOR VALUES WITH (modulus 64, remainder 19);


--
-- Name: blob_files_20; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_20 FOR VALUES WITH (modulus 64, remainder 20);


--
-- Name: blob_files_21; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_21 FOR VALUES WITH (modulus 64, remainder 21);


--
-- Name: blob_files_22; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_22 FOR VALUES WITH (modulus 64, remainder 22);


--
-- Name: blob_files_23; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_23 FOR VALUES WITH (modulus 64, remainder 23);


--
-- Name: blob_files_24; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_24 FOR VALUES WITH (modulus 64, remainder 24);


--
-- Name: blob_files_25; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_25 FOR VALUES WITH (modulus 64, remainder 25);


--
-- Name: blob_files_26; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_26 FOR VALUES WITH (modulus 64, remainder 26);


--
-- Name: blob_files_27; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_27 FOR VALUES WITH (modulus 64, remainder 27);


--
-- Name: blob_files_28; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_28 FOR VALUES WITH (modulus 64, remainder 28);


--
-- Name: blob_files_29; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_29 FOR VALUES WITH (modulus 64, remainder 29);


--
-- Name: blob_files_30; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_30 FOR VALUES WITH (modulus 64, remainder 30);


--
-- Name: blob_files_31; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_31 FOR VALUES WITH (modulus 64, remainder 31);


--
-- Name: blob_files_32; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_32 FOR VALUES WITH (modulus 64, remainder 32);


--
-- Name: blob_files_33; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_33 FOR VALUES WITH (modulus 64, remainder 33);


--
-- Name: blob_files_34; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_34 FOR VALUES WITH (modulus 64, remainder 34);


--
-- Name: blob_files_35; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_35 FOR VALUES WITH (modulus 64, remainder 35);


--
-- Name: blob_files_36; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_36 FOR VALUES WITH (modulus 64, remainder 36);


--
-- Name: blob_files_37; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_37 FOR VALUES WITH (modulus 64, remainder 37);


--
-- Name: blob_files_38; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_38 FOR VALUES WITH (modulus 64, remainder 38);


--
-- Name: blob_files_39; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_39 FOR VALUES WITH (modulus 64, remainder 39);


--
-- Name: blob_files_40; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_40 FOR VALUES WITH (modulus 64, remainder 40);


--
-- Name: blob_files_41; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_41 FOR VALUES WITH (modulus 64, remainder 41);


--
-- Name: blob_files_42; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_42 FOR VALUES WITH (modulus 64, remainder 42);


--
-- Name: blob_files_43; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_43 FOR VALUES WITH (modulus 64, remainder 43);


--
-- Name: blob_files_44; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_44 FOR VALUES WITH (modulus 64, remainder 44);


--
-- Name: blob_files_45; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_45 FOR VALUES WITH (modulus 64, remainder 45);


--
-- Name: blob_files_46; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_46 FOR VALUES WITH (modulus 64, remainder 46);


--
-- Name: blob_files_47; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_47 FOR VALUES WITH (modulus 64, remainder 47);


--
-- Name: blob_files_48; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_48 FOR VALUES WITH (modulus 64, remainder 48);


--
-- Name: blob_files_49; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_49 FOR VALUES WITH (modulus 64, remainder 49);


--
-- Name: blob_files_50; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_50 FOR VALUES WITH (modulus 64, remainder 50);


--
-- Name: blob_files_51; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_51 FOR VALUES WITH (modulus 64, remainder 51);


--
-- Name: blob_files_52; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_52 FOR VALUES WITH (modulus 64, remainder 52);


--
-- Name: blob_files_53; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_53 FOR VALUES WITH (modulus 64, remainder 53);


--
-- Name: blob_files_54; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_54 FOR VALUES WITH (modulus 64, remainder 54);


--
-- Name: blob_files_55; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_55 FOR VALUES WITH (modulus 64, remainder 55);


--
-- Name: blob_files_56; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_56 FOR VALUES WITH (modulus 64, remainder 56);


--
-- Name: blob_files_57; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_57 FOR VALUES WITH (modulus 64, remainder 57);


--
-- Name: blob_files_58; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_58 FOR VALUES WITH (modulus 64, remainder 58);


--
-- Name: blob_files_59; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_59 FOR VALUES WITH (modulus 64, remainder 59);


--
-- Name: blob_files_60; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_60 FOR VALUES WITH (modulus 64, remainder 60);


--
-- Name: blob_files_61; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_61 FOR VALUES WITH (modulus 64, remainder 61);


--
-- Name: blob_files_62; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_62 FOR VALUES WITH (modulus 64, remainder 62);


--
-- Name: blob_files_63; Type: TABLE ATTACH; Schema: public; Owner: -
--

ALTER TABLE ONLY public.blob_files ATTACH PARTITION public.blob_files_63 FOR VALUES WITH (modulus 64, remainder 63);


--
-- Name: domain_bluesky_monitored_objects id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_bluesky_monitored_objects ALTER COLUMN id SET DEFAULT nextval('public.domain_bluesky_monitored_objects_id_seq'::regclass);


--
-- Name: domain_fa_fav_id_and_dates id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_fa_fav_id_and_dates ALTER COLUMN id SET DEFAULT nextval('public.domain_fa_fav_id_and_dates_id_seq'::regclass);


--
-- Name: domain_post_file_bit_fingerprints id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_post_file_bit_fingerprints ALTER COLUMN id SET DEFAULT nextval('public.domain_post_file_bit_fingerprints_id_seq'::regclass);


--
-- Name: domain_post_file_thumbnails id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_post_file_thumbnails ALTER COLUMN id SET DEFAULT nextval('public.domain_post_file_thumbnails_id_seq'::regclass);


--
-- Name: domain_post_files id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_post_files ALTER COLUMN id SET DEFAULT nextval('public.domain_post_files_id_seq'::regclass);


--
-- Name: domain_post_files_bluesky_aux base_table_id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_post_files_bluesky_aux ALTER COLUMN base_table_id SET DEFAULT nextval('public.domain_post_files_bluesky_aux_base_table_id_seq'::regclass);


--
-- Name: domain_post_files_inkbunny_aux base_table_id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_post_files_inkbunny_aux ALTER COLUMN base_table_id SET DEFAULT nextval('public.domain_post_files_inkbunny_aux_base_table_id_seq'::regclass);


--
-- Name: domain_post_groups id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_post_groups ALTER COLUMN id SET DEFAULT nextval('public.domain_post_groups_id_seq'::regclass);


--
-- Name: domain_posts id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_posts ALTER COLUMN id SET DEFAULT nextval('public.domain_posts_id_seq'::regclass);


--
-- Name: domain_posts_bluesky_aux base_table_id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_posts_bluesky_aux ALTER COLUMN base_table_id SET DEFAULT nextval('public.domain_posts_bluesky_aux_base_table_id_seq'::regclass);


--
-- Name: domain_posts_e621_aux base_table_id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_posts_e621_aux ALTER COLUMN base_table_id SET DEFAULT nextval('public.domain_posts_e621_aux_base_table_id_seq'::regclass);


--
-- Name: domain_posts_fa_aux base_table_id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_posts_fa_aux ALTER COLUMN base_table_id SET DEFAULT nextval('public.domain_posts_fa_aux_base_table_id_seq'::regclass);


--
-- Name: domain_posts_ib_aux base_table_id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_posts_ib_aux ALTER COLUMN base_table_id SET DEFAULT nextval('public.domain_posts_ib_aux_base_table_id_seq'::regclass);


--
-- Name: domain_twitter_tweets id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_twitter_tweets ALTER COLUMN id SET DEFAULT nextval('public.domain_twitter_tweets_id_seq'::regclass);


--
-- Name: domain_twitter_user_versions id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_twitter_user_versions ALTER COLUMN id SET DEFAULT nextval('public.domain_twitter_user_versions_id_seq'::regclass);


--
-- Name: domain_twitter_users id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_twitter_users ALTER COLUMN id SET DEFAULT nextval('public.domain_twitter_users_id_seq'::regclass);


--
-- Name: domain_user_avatars id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_avatars ALTER COLUMN id SET DEFAULT nextval('public.domain_user_avatars_id_seq'::regclass);


--
-- Name: domain_user_job_event_add_tracked_objects id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_job_event_add_tracked_objects ALTER COLUMN id SET DEFAULT nextval('public.domain_user_job_event_add_tracked_objects_id_seq'::regclass);


--
-- Name: domain_user_job_event_follow_scans id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_job_event_follow_scans ALTER COLUMN id SET DEFAULT nextval('public.domain_user_job_event_follow_scans_id_seq'::regclass);


--
-- Name: domain_user_job_event_posts_scans id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_job_event_posts_scans ALTER COLUMN id SET DEFAULT nextval('public.domain_user_job_event_posts_scans_id_seq'::regclass);


--
-- Name: domain_user_job_event_profile_scans id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_job_event_profile_scans ALTER COLUMN id SET DEFAULT nextval('public.domain_user_job_event_profile_scans_id_seq'::regclass);


--
-- Name: domain_user_search_names id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_search_names ALTER COLUMN id SET DEFAULT nextval('public.domain_user_search_names_id_seq'::regclass);


--
-- Name: domain_users id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_users ALTER COLUMN id SET DEFAULT nextval('public.domain_users_id_seq'::regclass);


--
-- Name: domain_users_bluesky_aux base_table_id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_users_bluesky_aux ALTER COLUMN base_table_id SET DEFAULT nextval('public.domain_users_bluesky_aux_base_table_id_seq'::regclass);


--
-- Name: domain_users_e621_aux base_table_id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_users_e621_aux ALTER COLUMN base_table_id SET DEFAULT nextval('public.domain_users_e621_aux_base_table_id_seq'::regclass);


--
-- Name: domain_users_fa_aux base_table_id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_users_fa_aux ALTER COLUMN base_table_id SET DEFAULT nextval('public.domain_users_fa_aux_base_table_id_seq'::regclass);


--
-- Name: domain_users_inkbunny_aux base_table_id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_users_inkbunny_aux ALTER COLUMN base_table_id SET DEFAULT nextval('public.domain_users_inkbunny_aux_base_table_id_seq'::regclass);


--
-- Name: global_states id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.global_states ALTER COLUMN id SET DEFAULT nextval('public.global_states_id_seq'::regclass);


--
-- Name: good_job_execution_log_lines_collections id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.good_job_execution_log_lines_collections ALTER COLUMN id SET DEFAULT nextval('public.good_job_execution_log_lines_collections_id_seq'::regclass);


--
-- Name: http_log_entries id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.http_log_entries ALTER COLUMN id SET DEFAULT nextval('public.http_log_entries_id_seq'::regclass);


--
-- Name: http_log_entry_headers id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.http_log_entry_headers ALTER COLUMN id SET DEFAULT nextval('public.http_log_entry_headers_id_seq'::regclass);


--
-- Name: ip_address_roles id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ip_address_roles ALTER COLUMN id SET DEFAULT nextval('public.ip_address_roles_id_seq'::regclass);


--
-- Name: pghero_query_stats id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.pghero_query_stats ALTER COLUMN id SET DEFAULT nextval('public.pghero_query_stats_id_seq'::regclass);


--
-- Name: pghero_space_stats id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.pghero_space_stats ALTER COLUMN id SET DEFAULT nextval('public.pghero_space_stats_id_seq'::regclass);


--
-- Name: telegram_bot_logs id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.telegram_bot_logs ALTER COLUMN id SET DEFAULT nextval('public.telegram_bot_logs_id_seq'::regclass);


--
-- Name: trained_regression_models id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.trained_regression_models ALTER COLUMN id SET DEFAULT nextval('public.trained_regression_models_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: ar_internal_metadata ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ar_internal_metadata
    ADD CONSTRAINT ar_internal_metadata_pkey PRIMARY KEY (key);


--
-- Name: domain_bluesky_monitored_objects domain_bluesky_monitored_objects_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_bluesky_monitored_objects
    ADD CONSTRAINT domain_bluesky_monitored_objects_pkey PRIMARY KEY (id);


--
-- Name: domain_fa_fav_id_and_dates domain_fa_fav_id_and_dates_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_fa_fav_id_and_dates
    ADD CONSTRAINT domain_fa_fav_id_and_dates_pkey PRIMARY KEY (id);


--
-- Name: domain_post_file_bit_fingerprints domain_post_file_bit_fingerprints_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_post_file_bit_fingerprints
    ADD CONSTRAINT domain_post_file_bit_fingerprints_pkey PRIMARY KEY (id);


--
-- Name: domain_post_file_thumbnails domain_post_file_thumbnails_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_post_file_thumbnails
    ADD CONSTRAINT domain_post_file_thumbnails_pkey PRIMARY KEY (id);


--
-- Name: domain_post_files_bluesky_aux domain_post_files_bluesky_aux_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_post_files_bluesky_aux
    ADD CONSTRAINT domain_post_files_bluesky_aux_pkey PRIMARY KEY (base_table_id);


--
-- Name: domain_post_files_inkbunny_aux domain_post_files_inkbunny_aux_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_post_files_inkbunny_aux
    ADD CONSTRAINT domain_post_files_inkbunny_aux_pkey PRIMARY KEY (base_table_id);


--
-- Name: domain_post_files domain_post_files_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_post_files
    ADD CONSTRAINT domain_post_files_pkey PRIMARY KEY (id);


--
-- Name: domain_post_groups domain_post_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_post_groups
    ADD CONSTRAINT domain_post_groups_pkey PRIMARY KEY (id);


--
-- Name: domain_posts_bluesky_aux domain_posts_bluesky_aux_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_posts_bluesky_aux
    ADD CONSTRAINT domain_posts_bluesky_aux_pkey PRIMARY KEY (base_table_id);


--
-- Name: domain_posts_e621_aux domain_posts_e621_aux_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_posts_e621_aux
    ADD CONSTRAINT domain_posts_e621_aux_pkey PRIMARY KEY (base_table_id);


--
-- Name: domain_posts_fa_aux domain_posts_fa_aux_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_posts_fa_aux
    ADD CONSTRAINT domain_posts_fa_aux_pkey PRIMARY KEY (base_table_id);


--
-- Name: domain_posts_ib_aux domain_posts_ib_aux_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_posts_ib_aux
    ADD CONSTRAINT domain_posts_ib_aux_pkey PRIMARY KEY (base_table_id);


--
-- Name: domain_posts domain_posts_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_posts
    ADD CONSTRAINT domain_posts_pkey PRIMARY KEY (id);


--
-- Name: domain_twitter_tweets domain_twitter_tweets_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_twitter_tweets
    ADD CONSTRAINT domain_twitter_tweets_pkey PRIMARY KEY (id);


--
-- Name: domain_twitter_user_versions domain_twitter_user_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_twitter_user_versions
    ADD CONSTRAINT domain_twitter_user_versions_pkey PRIMARY KEY (id);


--
-- Name: domain_twitter_users domain_twitter_users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_twitter_users
    ADD CONSTRAINT domain_twitter_users_pkey PRIMARY KEY (id);


--
-- Name: domain_user_avatars domain_user_avatars_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_avatars
    ADD CONSTRAINT domain_user_avatars_pkey PRIMARY KEY (id);


--
-- Name: domain_user_job_event_add_tracked_objects domain_user_job_event_add_tracked_objects_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_job_event_add_tracked_objects
    ADD CONSTRAINT domain_user_job_event_add_tracked_objects_pkey PRIMARY KEY (id);


--
-- Name: domain_user_job_event_follow_scans domain_user_job_event_follow_scans_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_job_event_follow_scans
    ADD CONSTRAINT domain_user_job_event_follow_scans_pkey PRIMARY KEY (id);


--
-- Name: domain_user_job_event_posts_scans domain_user_job_event_posts_scans_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_job_event_posts_scans
    ADD CONSTRAINT domain_user_job_event_posts_scans_pkey PRIMARY KEY (id);


--
-- Name: domain_user_job_event_profile_scans domain_user_job_event_profile_scans_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_job_event_profile_scans
    ADD CONSTRAINT domain_user_job_event_profile_scans_pkey PRIMARY KEY (id);


--
-- Name: domain_user_post_favs_e621 domain_user_post_favs_e621_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_post_favs_e621
    ADD CONSTRAINT domain_user_post_favs_e621_pkey PRIMARY KEY (user_id, post_id);


--
-- Name: domain_user_post_favs_fa domain_user_post_favs_fa_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_post_favs_fa
    ADD CONSTRAINT domain_user_post_favs_fa_pkey PRIMARY KEY (user_id, post_id);


--
-- Name: domain_user_search_names domain_user_search_names_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_search_names
    ADD CONSTRAINT domain_user_search_names_pkey PRIMARY KEY (id);


--
-- Name: domain_users_bluesky_aux domain_users_bluesky_aux_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_users_bluesky_aux
    ADD CONSTRAINT domain_users_bluesky_aux_pkey PRIMARY KEY (base_table_id);


--
-- Name: domain_users_e621_aux domain_users_e621_aux_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_users_e621_aux
    ADD CONSTRAINT domain_users_e621_aux_pkey PRIMARY KEY (base_table_id);


--
-- Name: domain_users_fa_aux domain_users_fa_aux_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_users_fa_aux
    ADD CONSTRAINT domain_users_fa_aux_pkey PRIMARY KEY (base_table_id);


--
-- Name: domain_users_inkbunny_aux domain_users_inkbunny_aux_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_users_inkbunny_aux
    ADD CONSTRAINT domain_users_inkbunny_aux_pkey PRIMARY KEY (base_table_id);


--
-- Name: domain_users domain_users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_users
    ADD CONSTRAINT domain_users_pkey PRIMARY KEY (id);


--
-- Name: global_states global_states_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.global_states
    ADD CONSTRAINT global_states_pkey PRIMARY KEY (id);


--
-- Name: good_job_batches good_job_batches_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.good_job_batches
    ADD CONSTRAINT good_job_batches_pkey PRIMARY KEY (id);


--
-- Name: good_job_execution_log_lines_collections good_job_execution_log_lines_collections_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.good_job_execution_log_lines_collections
    ADD CONSTRAINT good_job_execution_log_lines_collections_pkey PRIMARY KEY (id);


--
-- Name: good_job_executions good_job_executions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.good_job_executions
    ADD CONSTRAINT good_job_executions_pkey PRIMARY KEY (id);


--
-- Name: good_job_processes good_job_processes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.good_job_processes
    ADD CONSTRAINT good_job_processes_pkey PRIMARY KEY (id);


--
-- Name: good_job_settings good_job_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.good_job_settings
    ADD CONSTRAINT good_job_settings_pkey PRIMARY KEY (id);


--
-- Name: good_jobs good_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.good_jobs
    ADD CONSTRAINT good_jobs_pkey PRIMARY KEY (id);


--
-- Name: http_log_entries http_log_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.http_log_entries
    ADD CONSTRAINT http_log_entries_pkey PRIMARY KEY (id);


--
-- Name: http_log_entry_headers http_log_entry_headers_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.http_log_entry_headers
    ADD CONSTRAINT http_log_entry_headers_pkey PRIMARY KEY (id);


--
-- Name: ip_address_roles ip_address_roles_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.ip_address_roles
    ADD CONSTRAINT ip_address_roles_pkey PRIMARY KEY (id);


--
-- Name: pghero_query_stats pghero_query_stats_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.pghero_query_stats
    ADD CONSTRAINT pghero_query_stats_pkey PRIMARY KEY (id);


--
-- Name: pghero_space_stats pghero_space_stats_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.pghero_space_stats
    ADD CONSTRAINT pghero_space_stats_pkey PRIMARY KEY (id);


--
-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.schema_migrations
    ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version);


--
-- Name: telegram_bot_logs telegram_bot_logs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.telegram_bot_logs
    ADD CONSTRAINT telegram_bot_logs_pkey PRIMARY KEY (id);


--
-- Name: trained_regression_models trained_regression_models_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.trained_regression_models
    ADD CONSTRAINT trained_regression_models_pkey PRIMARY KEY (id);


--
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.users
    ADD CONSTRAINT users_pkey PRIMARY KEY (id);


--
-- Name: good_jobs_error_finished_at_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX good_jobs_error_finished_at_idx ON public.good_jobs USING btree (error, finished_at);


--
-- Name: good_jobs_finished_at_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX good_jobs_finished_at_idx ON public.good_jobs USING btree (finished_at);


--
-- Name: good_jobs_performed_at_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX good_jobs_performed_at_idx ON public.good_jobs USING btree (performed_at);


--
-- Name: idx_domain_e621_posts_on_e621_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX idx_domain_e621_posts_on_e621_id ON public.domain_posts USING btree ((((json_attributes ->> 'e621_id'::text))::integer)) WHERE (type = 'Domain::Post::E621Post'::public.domain_post_type);


--
-- Name: idx_domain_e621_posts_on_uploader_user_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX idx_domain_e621_posts_on_uploader_user_id ON public.domain_posts USING btree ((((json_attributes ->> 'uploader_user_id'::text))::integer)) WHERE (type = 'Domain::Post::E621Post'::public.domain_post_type);


--
-- Name: idx_domain_e621_users_on_e621_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX idx_domain_e621_users_on_e621_id ON public.domain_users USING btree ((((json_attributes ->> 'e621_id'::text))::integer)) WHERE (type = 'Domain::User::E621User'::public.domain_user_type);


--
-- Name: idx_domain_fa_posts_on_fa_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX idx_domain_fa_posts_on_fa_id ON public.domain_posts USING btree ((((json_attributes ->> 'fa_id'::text))::integer)) WHERE (type = 'Domain::Post::FaPost'::public.domain_post_type);


--
-- Name: idx_domain_fa_users_on_url_name; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX idx_domain_fa_users_on_url_name ON public.domain_users USING btree (((json_attributes ->> 'url_name'::text))) WHERE (type = 'Domain::User::FaUser'::public.domain_user_type);


--
-- Name: idx_domain_inkbunny_posts_on_ib_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX idx_domain_inkbunny_posts_on_ib_id ON public.domain_posts USING btree ((((json_attributes ->> 'ib_id'::text))::integer)) WHERE (type = 'Domain::Post::InkbunnyPost'::public.domain_post_type);


--
-- Name: idx_domain_inkbunny_users_on_ib_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX idx_domain_inkbunny_users_on_ib_id ON public.domain_users USING btree ((((json_attributes ->> 'ib_id'::text))::integer)) WHERE (type = 'Domain::User::InkbunnyUser'::public.domain_user_type);


--
-- Name: idx_domain_inkbunny_users_on_name; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX idx_domain_inkbunny_users_on_name ON public.domain_users USING btree (((json_attributes ->> 'name'::text))) WHERE (type = 'Domain::User::InkbunnyUser'::public.domain_user_type);


--
-- Name: idx_domain_post_files_on_url_str_lower; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_domain_post_files_on_url_str_lower ON public.domain_post_files USING btree (lower('url_str'::text) text_pattern_ops);


--
-- Name: idx_domain_post_groups_on_owner_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_domain_post_groups_on_owner_id ON public.domain_post_groups USING btree ((((json_attributes ->> 'owner_id'::text))::integer)) WHERE (type = 'Domain::PostGroup::SofurryFolder'::public.domain_post_group_type);


--
-- Name: idx_domain_post_groups_on_sofurry_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX idx_domain_post_groups_on_sofurry_id ON public.domain_post_groups USING btree ((((json_attributes ->> 'sofurry_id'::text))::integer)) WHERE (type = 'Domain::PostGroup::SofurryFolder'::public.domain_post_group_type);


--
-- Name: idx_domain_posts_on_sofurry_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX idx_domain_posts_on_sofurry_id ON public.domain_posts USING btree ((((json_attributes ->> 'sofurry_id'::text))::integer)) WHERE (type = 'Domain::Post::SofurryPost'::public.domain_post_type);


--
-- Name: idx_domain_users_e621_on_name_lower; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_domain_users_e621_on_name_lower ON public.domain_users USING btree (lower((json_attributes ->> 'name'::text)) text_pattern_ops) WHERE (type = 'Domain::User::E621User'::public.domain_user_type);


--
-- Name: idx_domain_users_inkbunny_on_name_lower; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_domain_users_inkbunny_on_name_lower ON public.domain_users USING btree (lower((json_attributes ->> 'name'::text)) text_pattern_ops) WHERE (type = 'Domain::User::InkbunnyUser'::public.domain_user_type);


--
-- Name: idx_domain_users_on_migrated_user_favs_at; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_domain_users_on_migrated_user_favs_at ON public.domain_users USING btree (((json_attributes ->> 'migrated_user_favs_at'::text)));


--
-- Name: idx_domain_users_on_sofurry_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX idx_domain_users_on_sofurry_id ON public.domain_users USING btree ((((json_attributes ->> 'sofurry_id'::text))::integer)) WHERE (type = 'Domain::User::SofurryUser'::public.domain_user_type);


--
-- Name: idx_domain_users_on_useralias; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX idx_domain_users_on_useralias ON public.domain_users USING btree (((json_attributes ->> 'useralias'::text))) WHERE (type = 'Domain::User::SofurryUser'::public.domain_user_type);


--
-- Name: idx_domain_users_on_username; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX idx_domain_users_on_username ON public.domain_users USING btree (((json_attributes ->> 'username'::text))) WHERE (type = 'Domain::User::SofurryUser'::public.domain_user_type);


--
-- Name: idx_on_good_job_execution_id_685ddb5560; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX idx_on_good_job_execution_id_685ddb5560 ON public.good_job_execution_log_lines_collections USING btree (good_job_execution_id);


--
-- Name: idx_on_kind_user_id_0795b93670; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_on_kind_user_id_0795b93670 ON public.domain_user_job_event_add_tracked_objects USING btree (kind, user_id);


--
-- Name: idx_on_log_entry_id_d2ff8ab4cf; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_on_log_entry_id_d2ff8ab4cf ON public.domain_user_job_event_add_tracked_objects USING btree (log_entry_id);


--
-- Name: idx_on_post_file_id_thumb_type_frame_17152086d1; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX idx_on_post_file_id_thumb_type_frame_17152086d1 ON public.domain_post_file_thumbnails USING btree (post_file_id, thumb_type, frame);


--
-- Name: idx_on_post_file_id_thumbnail_id_28e9a641fb; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX idx_on_post_file_id_thumbnail_id_28e9a641fb ON public.domain_post_file_bit_fingerprints USING btree (post_file_id, thumbnail_id);


--
-- Name: idx_on_telegram_user_id_request_timestamp_075ae9ab44; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_on_telegram_user_id_request_timestamp_075ae9ab44 ON public.telegram_bot_logs USING btree (telegram_user_id, request_timestamp);


--
-- Name: index_blob_files_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_on_sha256 ON ONLY public.blob_files USING btree (sha256);


--
-- Name: index_blob_files_00_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_00_on_sha256 ON public.blob_files_00 USING btree (sha256);


--
-- Name: index_blob_files_01_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_01_on_sha256 ON public.blob_files_01 USING btree (sha256);


--
-- Name: index_blob_files_02_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_02_on_sha256 ON public.blob_files_02 USING btree (sha256);


--
-- Name: index_blob_files_03_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_03_on_sha256 ON public.blob_files_03 USING btree (sha256);


--
-- Name: index_blob_files_04_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_04_on_sha256 ON public.blob_files_04 USING btree (sha256);


--
-- Name: index_blob_files_05_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_05_on_sha256 ON public.blob_files_05 USING btree (sha256);


--
-- Name: index_blob_files_06_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_06_on_sha256 ON public.blob_files_06 USING btree (sha256);


--
-- Name: index_blob_files_07_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_07_on_sha256 ON public.blob_files_07 USING btree (sha256);


--
-- Name: index_blob_files_08_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_08_on_sha256 ON public.blob_files_08 USING btree (sha256);


--
-- Name: index_blob_files_09_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_09_on_sha256 ON public.blob_files_09 USING btree (sha256);


--
-- Name: index_blob_files_10_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_10_on_sha256 ON public.blob_files_10 USING btree (sha256);


--
-- Name: index_blob_files_11_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_11_on_sha256 ON public.blob_files_11 USING btree (sha256);


--
-- Name: index_blob_files_12_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_12_on_sha256 ON public.blob_files_12 USING btree (sha256);


--
-- Name: index_blob_files_13_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_13_on_sha256 ON public.blob_files_13 USING btree (sha256);


--
-- Name: index_blob_files_14_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_14_on_sha256 ON public.blob_files_14 USING btree (sha256);


--
-- Name: index_blob_files_15_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_15_on_sha256 ON public.blob_files_15 USING btree (sha256);


--
-- Name: index_blob_files_16_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_16_on_sha256 ON public.blob_files_16 USING btree (sha256);


--
-- Name: index_blob_files_17_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_17_on_sha256 ON public.blob_files_17 USING btree (sha256);


--
-- Name: index_blob_files_18_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_18_on_sha256 ON public.blob_files_18 USING btree (sha256);


--
-- Name: index_blob_files_19_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_19_on_sha256 ON public.blob_files_19 USING btree (sha256);


--
-- Name: index_blob_files_20_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_20_on_sha256 ON public.blob_files_20 USING btree (sha256);


--
-- Name: index_blob_files_21_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_21_on_sha256 ON public.blob_files_21 USING btree (sha256);


--
-- Name: index_blob_files_22_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_22_on_sha256 ON public.blob_files_22 USING btree (sha256);


--
-- Name: index_blob_files_23_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_23_on_sha256 ON public.blob_files_23 USING btree (sha256);


--
-- Name: index_blob_files_24_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_24_on_sha256 ON public.blob_files_24 USING btree (sha256);


--
-- Name: index_blob_files_25_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_25_on_sha256 ON public.blob_files_25 USING btree (sha256);


--
-- Name: index_blob_files_26_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_26_on_sha256 ON public.blob_files_26 USING btree (sha256);


--
-- Name: index_blob_files_27_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_27_on_sha256 ON public.blob_files_27 USING btree (sha256);


--
-- Name: index_blob_files_28_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_28_on_sha256 ON public.blob_files_28 USING btree (sha256);


--
-- Name: index_blob_files_29_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_29_on_sha256 ON public.blob_files_29 USING btree (sha256);


--
-- Name: index_blob_files_30_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_30_on_sha256 ON public.blob_files_30 USING btree (sha256);


--
-- Name: index_blob_files_31_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_31_on_sha256 ON public.blob_files_31 USING btree (sha256);


--
-- Name: index_blob_files_32_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_32_on_sha256 ON public.blob_files_32 USING btree (sha256);


--
-- Name: index_blob_files_33_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_33_on_sha256 ON public.blob_files_33 USING btree (sha256);


--
-- Name: index_blob_files_34_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_34_on_sha256 ON public.blob_files_34 USING btree (sha256);


--
-- Name: index_blob_files_35_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_35_on_sha256 ON public.blob_files_35 USING btree (sha256);


--
-- Name: index_blob_files_36_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_36_on_sha256 ON public.blob_files_36 USING btree (sha256);


--
-- Name: index_blob_files_37_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_37_on_sha256 ON public.blob_files_37 USING btree (sha256);


--
-- Name: index_blob_files_38_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_38_on_sha256 ON public.blob_files_38 USING btree (sha256);


--
-- Name: index_blob_files_39_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_39_on_sha256 ON public.blob_files_39 USING btree (sha256);


--
-- Name: index_blob_files_40_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_40_on_sha256 ON public.blob_files_40 USING btree (sha256);


--
-- Name: index_blob_files_41_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_41_on_sha256 ON public.blob_files_41 USING btree (sha256);


--
-- Name: index_blob_files_42_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_42_on_sha256 ON public.blob_files_42 USING btree (sha256);


--
-- Name: index_blob_files_43_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_43_on_sha256 ON public.blob_files_43 USING btree (sha256);


--
-- Name: index_blob_files_44_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_44_on_sha256 ON public.blob_files_44 USING btree (sha256);


--
-- Name: index_blob_files_45_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_45_on_sha256 ON public.blob_files_45 USING btree (sha256);


--
-- Name: index_blob_files_46_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_46_on_sha256 ON public.blob_files_46 USING btree (sha256);


--
-- Name: index_blob_files_47_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_47_on_sha256 ON public.blob_files_47 USING btree (sha256);


--
-- Name: index_blob_files_48_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_48_on_sha256 ON public.blob_files_48 USING btree (sha256);


--
-- Name: index_blob_files_49_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_49_on_sha256 ON public.blob_files_49 USING btree (sha256);


--
-- Name: index_blob_files_50_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_50_on_sha256 ON public.blob_files_50 USING btree (sha256);


--
-- Name: index_blob_files_51_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_51_on_sha256 ON public.blob_files_51 USING btree (sha256);


--
-- Name: index_blob_files_52_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_52_on_sha256 ON public.blob_files_52 USING btree (sha256);


--
-- Name: index_blob_files_53_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_53_on_sha256 ON public.blob_files_53 USING btree (sha256);


--
-- Name: index_blob_files_54_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_54_on_sha256 ON public.blob_files_54 USING btree (sha256);


--
-- Name: index_blob_files_55_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_55_on_sha256 ON public.blob_files_55 USING btree (sha256);


--
-- Name: index_blob_files_56_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_56_on_sha256 ON public.blob_files_56 USING btree (sha256);


--
-- Name: index_blob_files_57_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_57_on_sha256 ON public.blob_files_57 USING btree (sha256);


--
-- Name: index_blob_files_58_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_58_on_sha256 ON public.blob_files_58 USING btree (sha256);


--
-- Name: index_blob_files_59_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_59_on_sha256 ON public.blob_files_59 USING btree (sha256);


--
-- Name: index_blob_files_60_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_60_on_sha256 ON public.blob_files_60 USING btree (sha256);


--
-- Name: index_blob_files_61_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_61_on_sha256 ON public.blob_files_61 USING btree (sha256);


--
-- Name: index_blob_files_62_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_62_on_sha256 ON public.blob_files_62 USING btree (sha256);


--
-- Name: index_blob_files_63_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_blob_files_63_on_sha256 ON public.blob_files_63 USING btree (sha256);


--
-- Name: index_domain_bluesky_monitored_objects_on_value; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_domain_bluesky_monitored_objects_on_value ON public.domain_bluesky_monitored_objects USING btree (value);


--
-- Name: index_domain_fa_fav_id_and_dates_on_fav_fa_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_fa_fav_id_and_dates_on_fav_fa_id ON public.domain_fa_fav_id_and_dates USING btree (fav_fa_id);


--
-- Name: index_domain_fa_fav_id_and_dates_on_user_id_and_post_fa_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_domain_fa_fav_id_and_dates_on_user_id_and_post_fa_id ON public.domain_fa_fav_id_and_dates USING btree (user_id, post_fa_id);


--
-- Name: index_domain_post_files_inkbunny_aux_on_ib_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_post_files_inkbunny_aux_on_ib_id ON public.domain_post_files_inkbunny_aux USING btree (ib_id);


--
-- Name: index_domain_post_files_on_log_entry_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_domain_post_files_on_log_entry_id ON public.domain_post_files USING btree (log_entry_id);


--
-- Name: index_domain_post_files_on_post_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_post_files_on_post_id ON public.domain_post_files USING btree (post_id);


--
-- Name: index_domain_post_files_on_type; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_post_files_on_type ON public.domain_post_files USING btree (type);


--
-- Name: index_domain_post_group_joins_on_group_id_and_post_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_post_group_joins_on_group_id_and_post_id ON public.domain_post_group_joins USING btree (group_id, post_id);


--
-- Name: index_domain_post_group_joins_on_post_id_and_group_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_domain_post_group_joins_on_post_id_and_group_id ON public.domain_post_group_joins USING btree (post_id, group_id);


--
-- Name: index_domain_post_group_joins_on_type; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_post_group_joins_on_type ON public.domain_post_group_joins USING btree (type);


--
-- Name: index_domain_post_groups_on_type; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_post_groups_on_type ON public.domain_post_groups USING btree (type);


--
-- Name: index_domain_posts_bluesky_aux_on_at_uri; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_domain_posts_bluesky_aux_on_at_uri ON public.domain_posts_bluesky_aux USING btree (at_uri);


--
-- Name: index_domain_posts_bluesky_aux_on_first_seen_entry_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_posts_bluesky_aux_on_first_seen_entry_id ON public.domain_posts_bluesky_aux USING btree (first_seen_entry_id);


--
-- Name: index_domain_posts_bluesky_aux_on_quote_uri; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_posts_bluesky_aux_on_quote_uri ON public.domain_posts_bluesky_aux USING btree (quote_uri);


--
-- Name: index_domain_posts_bluesky_aux_on_reply_to_uri; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_posts_bluesky_aux_on_reply_to_uri ON public.domain_posts_bluesky_aux USING btree (reply_to_uri);


--
-- Name: index_domain_posts_fa_aux_on_fa_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_domain_posts_fa_aux_on_fa_id ON public.domain_posts_fa_aux USING btree (fa_id);


--
-- Name: index_domain_posts_ib_aux_on_ib_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_domain_posts_ib_aux_on_ib_id ON public.domain_posts_ib_aux USING btree (ib_id);


--
-- Name: index_domain_posts_on_posted_at; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_posts_on_posted_at ON public.domain_posts USING btree (posted_at);


--
-- Name: index_domain_posts_on_posted_at_desc_nulls_last; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_posts_on_posted_at_desc_nulls_last ON public.domain_posts USING btree (posted_at DESC NULLS LAST);


--
-- Name: index_domain_posts_on_type; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_posts_on_type ON public.domain_posts USING btree (type);


--
-- Name: index_domain_twitter_medias_on_file_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_twitter_medias_on_file_id ON public.domain_twitter_medias USING btree (file_id);


--
-- Name: index_domain_twitter_medias_on_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_domain_twitter_medias_on_id ON public.domain_twitter_medias USING btree (id);


--
-- Name: index_domain_twitter_medias_on_tweet_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_twitter_medias_on_tweet_id ON public.domain_twitter_medias USING btree (tweet_id);


--
-- Name: index_domain_twitter_tweets_on_author_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_twitter_tweets_on_author_id ON public.domain_twitter_tweets USING btree (author_id);


--
-- Name: index_domain_twitter_tweets_on_reply_to_tweet_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_twitter_tweets_on_reply_to_tweet_id ON public.domain_twitter_tweets USING btree (reply_to_tweet_id);


--
-- Name: index_domain_twitter_user_versions_on_item_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_twitter_user_versions_on_item_id ON public.domain_twitter_user_versions USING btree (item_id);


--
-- Name: index_domain_twitter_users_on_name; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_domain_twitter_users_on_name ON public.domain_twitter_users USING btree (name);


--
-- Name: index_domain_twitter_users_on_tw_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_domain_twitter_users_on_tw_id ON public.domain_twitter_users USING btree (tw_id);


--
-- Name: index_domain_user_avatars_on_user_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_user_avatars_on_user_id ON public.domain_user_avatars USING btree (user_id);


--
-- Name: index_domain_user_job_event_add_tracked_objects_on_user_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_user_job_event_add_tracked_objects_on_user_id ON public.domain_user_job_event_add_tracked_objects USING btree (user_id);


--
-- Name: index_domain_user_job_event_follow_scans_on_user_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_user_job_event_follow_scans_on_user_id ON public.domain_user_job_event_follow_scans USING btree (user_id);


--
-- Name: index_domain_user_job_event_posts_scans_on_user_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_user_job_event_posts_scans_on_user_id ON public.domain_user_job_event_posts_scans USING btree (user_id);


--
-- Name: index_domain_user_job_event_profile_scans_on_user_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_user_job_event_profile_scans_on_user_id ON public.domain_user_job_event_profile_scans USING btree (user_id);


--
-- Name: index_domain_user_post_creations_on_post_id_and_user_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_user_post_creations_on_post_id_and_user_id ON public.domain_user_post_creations USING btree (post_id, user_id);


--
-- Name: index_domain_user_post_creations_on_user_id_and_post_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_domain_user_post_creations_on_user_id_and_post_id ON public.domain_user_post_creations USING btree (user_id, post_id);


--
-- Name: index_domain_user_post_fav_post_factors_on_embedding; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_user_post_fav_post_factors_on_embedding ON public.domain_user_post_fav_post_factors USING hnsw (embedding public.vector_l2_ops) WITH (m='16', ef_construction='64');


--
-- Name: index_domain_user_post_fav_post_factors_on_post_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_domain_user_post_fav_post_factors_on_post_id ON public.domain_user_post_fav_post_factors USING btree (post_id);


--
-- Name: index_domain_user_post_fav_user_factors_on_embedding; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_user_post_fav_user_factors_on_embedding ON public.domain_user_post_fav_user_factors USING ivfflat (embedding);


--
-- Name: index_domain_user_post_fav_user_factors_on_user_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_domain_user_post_fav_user_factors_on_user_id ON public.domain_user_post_fav_user_factors USING btree (user_id);


--
-- Name: index_domain_user_post_favs_e621_on_post_id_and_user_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_user_post_favs_e621_on_post_id_and_user_id ON public.domain_user_post_favs_e621 USING btree (post_id, user_id);


--
-- Name: index_domain_user_post_favs_fa_on_fa_fav_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_domain_user_post_favs_fa_on_fa_fav_id ON public.domain_user_post_favs_fa USING btree (fa_fav_id);


--
-- Name: index_domain_user_post_favs_fa_on_fa_fav_id_and_explicit_time; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_user_post_favs_fa_on_fa_fav_id_and_explicit_time ON public.domain_user_post_favs_fa USING btree (fa_fav_id, explicit_time) WHERE (explicit_time IS NOT NULL);


--
-- Name: index_domain_user_post_favs_fa_on_post_id_and_user_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_user_post_favs_fa_on_post_id_and_user_id ON public.domain_user_post_favs_fa USING btree (post_id, user_id);


--
-- Name: index_domain_user_post_favs_fa_on_user_id_and_inferred_time; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_user_post_favs_fa_on_user_id_and_inferred_time ON public.domain_user_post_favs_fa USING btree (user_id, inferred_time);


--
-- Name: index_domain_user_post_favs_on_post_id_and_user_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_user_post_favs_on_post_id_and_user_id ON public.domain_user_post_favs USING btree (post_id, user_id);


--
-- Name: index_domain_user_post_favs_on_user_id_and_post_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_domain_user_post_favs_on_user_id_and_post_id ON public.domain_user_post_favs USING btree (user_id, post_id);


--
-- Name: index_domain_user_search_names_on_dmetaphone_alt; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_user_search_names_on_dmetaphone_alt ON public.domain_user_search_names USING gin (dmetaphone_alt public.gin_trgm_ops);


--
-- Name: index_domain_user_search_names_on_dmetaphone_primary; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_user_search_names_on_dmetaphone_primary ON public.domain_user_search_names USING gin (dmetaphone_primary public.gin_trgm_ops);


--
-- Name: index_domain_user_search_names_on_name; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_user_search_names_on_name ON public.domain_user_search_names USING gin (name public.gin_trgm_ops);


--
-- Name: index_domain_user_search_names_on_user_id_and_name; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_domain_user_search_names_on_user_id_and_name ON public.domain_user_search_names USING btree (user_id, name);


--
-- Name: index_domain_user_user_follow_from_factors_on_embedding; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_user_user_follow_from_factors_on_embedding ON public.domain_user_user_follow_from_factors USING ivfflat (embedding public.vector_cosine_ops) WITH (lists='5000');


--
-- Name: index_domain_user_user_follow_from_factors_on_user_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_domain_user_user_follow_from_factors_on_user_id ON public.domain_user_user_follow_from_factors USING btree (user_id);


--
-- Name: index_domain_user_user_follow_to_factors_on_embedding; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_user_user_follow_to_factors_on_embedding ON public.domain_user_user_follow_to_factors USING hnsw (embedding public.vector_l2_ops) WITH (m='16', ef_construction='64');


--
-- Name: index_domain_user_user_follow_to_factors_on_user_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_domain_user_user_follow_to_factors_on_user_id ON public.domain_user_user_follow_to_factors USING btree (user_id);


--
-- Name: index_domain_user_user_follows_on_from_id_and_to_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_domain_user_user_follows_on_from_id_and_to_id ON public.domain_user_user_follows USING btree (from_id, to_id);


--
-- Name: index_domain_user_user_follows_on_to_id_and_from_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_user_user_follows_on_to_id_and_from_id ON public.domain_user_user_follows USING btree (to_id, from_id);


--
-- Name: index_domain_users_bluesky_aux_on_did; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_users_bluesky_aux_on_did ON public.domain_users_bluesky_aux USING btree (did);


--
-- Name: index_domain_users_bluesky_aux_on_handle; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_users_bluesky_aux_on_handle ON public.domain_users_bluesky_aux USING btree (handle);


--
-- Name: index_domain_users_e621_aux_on_e621_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_users_e621_aux_on_e621_id ON public.domain_users_e621_aux USING btree (e621_id);


--
-- Name: index_domain_users_e621_aux_on_name; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_users_e621_aux_on_name ON public.domain_users_e621_aux USING btree (name);


--
-- Name: index_domain_users_fa_aux_on_full_name; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_users_fa_aux_on_full_name ON public.domain_users_fa_aux USING btree (full_name);


--
-- Name: index_domain_users_fa_aux_on_last_gallery_page_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_users_fa_aux_on_last_gallery_page_id ON public.domain_users_fa_aux USING btree (last_gallery_page_id);


--
-- Name: index_domain_users_fa_aux_on_last_user_page_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_users_fa_aux_on_last_user_page_id ON public.domain_users_fa_aux USING btree (last_user_page_id);


--
-- Name: index_domain_users_fa_aux_on_scanned_gallery_at; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_users_fa_aux_on_scanned_gallery_at ON public.domain_users_fa_aux USING btree (scanned_gallery_at);


--
-- Name: index_domain_users_fa_aux_on_scanned_page_at; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_users_fa_aux_on_scanned_page_at ON public.domain_users_fa_aux USING btree (scanned_page_at);


--
-- Name: index_domain_users_fa_aux_on_url_name; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_users_fa_aux_on_url_name ON public.domain_users_fa_aux USING btree (url_name);


--
-- Name: index_domain_users_inkbunny_aux_on_deep_update_log_entry_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_users_inkbunny_aux_on_deep_update_log_entry_id ON public.domain_users_inkbunny_aux USING btree (deep_update_log_entry_id);


--
-- Name: index_domain_users_inkbunny_aux_on_ib_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_users_inkbunny_aux_on_ib_id ON public.domain_users_inkbunny_aux USING btree (ib_id);


--
-- Name: index_domain_users_inkbunny_aux_on_name; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_users_inkbunny_aux_on_name ON public.domain_users_inkbunny_aux USING btree (name);


--
-- Name: index_domain_users_inkbunny_aux_on_shallow_update_log_entry_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_users_inkbunny_aux_on_shallow_update_log_entry_id ON public.domain_users_inkbunny_aux USING btree (shallow_update_log_entry_id);


--
-- Name: index_domain_users_on_type; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_domain_users_on_type ON public.domain_users USING btree (type);


--
-- Name: index_global_states_on_key; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_global_states_on_key ON public.global_states USING btree (key);


--
-- Name: index_good_job_executions_on_active_job_id_and_created_at; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_good_job_executions_on_active_job_id_and_created_at ON public.good_job_executions USING btree (active_job_id, created_at);


--
-- Name: index_good_job_executions_on_process_id_and_created_at; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_good_job_executions_on_process_id_and_created_at ON public.good_job_executions USING btree (process_id, created_at);


--
-- Name: index_good_job_jobs_for_candidate_lookup; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_good_job_jobs_for_candidate_lookup ON public.good_jobs USING btree (priority, created_at) WHERE (finished_at IS NULL);


--
-- Name: index_good_job_settings_on_key; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_good_job_settings_on_key ON public.good_job_settings USING btree (key);


--
-- Name: index_good_jobs_jobs_on_finished_at; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_good_jobs_jobs_on_finished_at ON public.good_jobs USING btree (finished_at) WHERE ((retried_good_job_id IS NULL) AND (finished_at IS NOT NULL));


--
-- Name: index_good_jobs_jobs_on_priority_created_at_when_unfinished; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_good_jobs_jobs_on_priority_created_at_when_unfinished ON public.good_jobs USING btree (priority DESC NULLS LAST, created_at) WHERE (finished_at IS NULL);


--
-- Name: index_good_jobs_on_active_job_id_and_created_at; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_good_jobs_on_active_job_id_and_created_at ON public.good_jobs USING btree (active_job_id, created_at);


--
-- Name: index_good_jobs_on_batch_callback_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_good_jobs_on_batch_callback_id ON public.good_jobs USING btree (batch_callback_id) WHERE (batch_callback_id IS NOT NULL);


--
-- Name: index_good_jobs_on_batch_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_good_jobs_on_batch_id ON public.good_jobs USING btree (batch_id) WHERE (batch_id IS NOT NULL);


--
-- Name: index_good_jobs_on_concurrency_key_when_unfinished; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_good_jobs_on_concurrency_key_when_unfinished ON public.good_jobs USING btree (concurrency_key) WHERE (finished_at IS NULL);


--
-- Name: index_good_jobs_on_cron_key_and_created_at_cond; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_good_jobs_on_cron_key_and_created_at_cond ON public.good_jobs USING btree (cron_key, created_at) WHERE (cron_key IS NOT NULL);


--
-- Name: index_good_jobs_on_cron_key_and_cron_at_cond; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_good_jobs_on_cron_key_and_cron_at_cond ON public.good_jobs USING btree (cron_key, cron_at) WHERE (cron_key IS NOT NULL);


--
-- Name: index_good_jobs_on_labels; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_good_jobs_on_labels ON public.good_jobs USING gin (labels) WHERE (labels IS NOT NULL);


--
-- Name: index_good_jobs_on_locked_by_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_good_jobs_on_locked_by_id ON public.good_jobs USING btree (locked_by_id) WHERE (locked_by_id IS NOT NULL);


--
-- Name: index_good_jobs_on_priority_scheduled_at_unfinished_unlocked; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_good_jobs_on_priority_scheduled_at_unfinished_unlocked ON public.good_jobs USING btree (priority, scheduled_at) WHERE ((finished_at IS NULL) AND (locked_by_id IS NULL));


--
-- Name: index_good_jobs_on_queue_name_and_scheduled_at; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_good_jobs_on_queue_name_and_scheduled_at ON public.good_jobs USING btree (queue_name, scheduled_at) WHERE (finished_at IS NULL);


--
-- Name: index_good_jobs_on_scheduled_at; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_good_jobs_on_scheduled_at ON public.good_jobs USING btree (scheduled_at) WHERE (finished_at IS NULL);


--
-- Name: index_http_log_entries_on_caused_by_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_http_log_entries_on_caused_by_id ON public.http_log_entries USING btree (caused_by_id);


--
-- Name: index_http_log_entries_on_response_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_http_log_entries_on_response_sha256 ON public.http_log_entries USING hash (response_sha256);


--
-- Name: index_http_log_entries_on_uri_host_path_query; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_http_log_entries_on_uri_host_path_query ON public.http_log_entries USING btree (uri_host, uri_path, uri_query);


--
-- Name: index_http_log_entry_headers_on_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_http_log_entry_headers_on_sha256 ON public.http_log_entry_headers USING btree (sha256);


--
-- Name: index_ip_address_roles_on_ip_address; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_ip_address_roles_on_ip_address ON public.ip_address_roles USING btree (ip_address);


--
-- Name: index_pghero_query_stats_on_database_and_captured_at; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_pghero_query_stats_on_database_and_captured_at ON public.pghero_query_stats USING btree (database, captured_at);


--
-- Name: index_pghero_space_stats_on_database_and_captured_at; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_pghero_space_stats_on_database_and_captured_at ON public.pghero_space_stats USING btree (database, captured_at);


--
-- Name: index_telegram_bot_logs_on_processed_image_sha256; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_telegram_bot_logs_on_processed_image_sha256 ON public.telegram_bot_logs USING btree (processed_image_sha256);


--
-- Name: index_telegram_bot_logs_on_request_timestamp; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_telegram_bot_logs_on_request_timestamp ON public.telegram_bot_logs USING btree (request_timestamp);


--
-- Name: index_telegram_bot_logs_on_search_results_count; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_telegram_bot_logs_on_search_results_count ON public.telegram_bot_logs USING btree (search_results_count);


--
-- Name: index_trained_regression_models_on_created_at; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_trained_regression_models_on_created_at ON public.trained_regression_models USING btree (created_at);


--
-- Name: index_trained_regression_models_on_evaluation_r_squared; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_trained_regression_models_on_evaluation_r_squared ON public.trained_regression_models USING btree (evaluation_r_squared);


--
-- Name: index_trained_regression_models_on_model_type; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_trained_regression_models_on_model_type ON public.trained_regression_models USING btree (model_type);


--
-- Name: index_trained_regression_models_on_name; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_trained_regression_models_on_name ON public.trained_regression_models USING btree (name);


--
-- Name: index_trained_regression_models_on_training_r_squared; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_trained_regression_models_on_training_r_squared ON public.trained_regression_models USING btree (training_r_squared);


--
-- Name: index_users_on_email; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_users_on_email ON public.users USING btree (email);


--
-- Name: index_users_on_reset_password_token; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_users_on_reset_password_token ON public.users USING btree (reset_password_token);


--
-- Name: ivfflat_index_on_fingerprint_value; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX ivfflat_index_on_fingerprint_value ON public.domain_post_file_bit_fingerprints USING ivfflat (fingerprint_value public.bit_hamming_ops) WITH (lists='5000');


--
-- Name: temp_domain_posts_type_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX temp_domain_posts_type_id ON public.domain_posts USING btree (type, id);


--
-- Name: index_blob_files_00_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_00_on_sha256;


--
-- Name: index_blob_files_01_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_01_on_sha256;


--
-- Name: index_blob_files_02_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_02_on_sha256;


--
-- Name: index_blob_files_03_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_03_on_sha256;


--
-- Name: index_blob_files_04_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_04_on_sha256;


--
-- Name: index_blob_files_05_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_05_on_sha256;


--
-- Name: index_blob_files_06_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_06_on_sha256;


--
-- Name: index_blob_files_07_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_07_on_sha256;


--
-- Name: index_blob_files_08_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_08_on_sha256;


--
-- Name: index_blob_files_09_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_09_on_sha256;


--
-- Name: index_blob_files_10_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_10_on_sha256;


--
-- Name: index_blob_files_11_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_11_on_sha256;


--
-- Name: index_blob_files_12_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_12_on_sha256;


--
-- Name: index_blob_files_13_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_13_on_sha256;


--
-- Name: index_blob_files_14_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_14_on_sha256;


--
-- Name: index_blob_files_15_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_15_on_sha256;


--
-- Name: index_blob_files_16_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_16_on_sha256;


--
-- Name: index_blob_files_17_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_17_on_sha256;


--
-- Name: index_blob_files_18_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_18_on_sha256;


--
-- Name: index_blob_files_19_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_19_on_sha256;


--
-- Name: index_blob_files_20_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_20_on_sha256;


--
-- Name: index_blob_files_21_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_21_on_sha256;


--
-- Name: index_blob_files_22_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_22_on_sha256;


--
-- Name: index_blob_files_23_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_23_on_sha256;


--
-- Name: index_blob_files_24_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_24_on_sha256;


--
-- Name: index_blob_files_25_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_25_on_sha256;


--
-- Name: index_blob_files_26_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_26_on_sha256;


--
-- Name: index_blob_files_27_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_27_on_sha256;


--
-- Name: index_blob_files_28_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_28_on_sha256;


--
-- Name: index_blob_files_29_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_29_on_sha256;


--
-- Name: index_blob_files_30_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_30_on_sha256;


--
-- Name: index_blob_files_31_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_31_on_sha256;


--
-- Name: index_blob_files_32_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_32_on_sha256;


--
-- Name: index_blob_files_33_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_33_on_sha256;


--
-- Name: index_blob_files_34_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_34_on_sha256;


--
-- Name: index_blob_files_35_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_35_on_sha256;


--
-- Name: index_blob_files_36_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_36_on_sha256;


--
-- Name: index_blob_files_37_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_37_on_sha256;


--
-- Name: index_blob_files_38_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_38_on_sha256;


--
-- Name: index_blob_files_39_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_39_on_sha256;


--
-- Name: index_blob_files_40_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_40_on_sha256;


--
-- Name: index_blob_files_41_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_41_on_sha256;


--
-- Name: index_blob_files_42_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_42_on_sha256;


--
-- Name: index_blob_files_43_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_43_on_sha256;


--
-- Name: index_blob_files_44_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_44_on_sha256;


--
-- Name: index_blob_files_45_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_45_on_sha256;


--
-- Name: index_blob_files_46_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_46_on_sha256;


--
-- Name: index_blob_files_47_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_47_on_sha256;


--
-- Name: index_blob_files_48_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_48_on_sha256;


--
-- Name: index_blob_files_49_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_49_on_sha256;


--
-- Name: index_blob_files_50_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_50_on_sha256;


--
-- Name: index_blob_files_51_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_51_on_sha256;


--
-- Name: index_blob_files_52_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_52_on_sha256;


--
-- Name: index_blob_files_53_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_53_on_sha256;


--
-- Name: index_blob_files_54_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_54_on_sha256;


--
-- Name: index_blob_files_55_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_55_on_sha256;


--
-- Name: index_blob_files_56_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_56_on_sha256;


--
-- Name: index_blob_files_57_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_57_on_sha256;


--
-- Name: index_blob_files_58_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_58_on_sha256;


--
-- Name: index_blob_files_59_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_59_on_sha256;


--
-- Name: index_blob_files_60_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_60_on_sha256;


--
-- Name: index_blob_files_61_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_61_on_sha256;


--
-- Name: index_blob_files_62_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_62_on_sha256;


--
-- Name: index_blob_files_63_on_sha256; Type: INDEX ATTACH; Schema: public; Owner: -
--

ALTER INDEX public.index_blob_files_on_sha256 ATTACH PARTITION public.index_blob_files_63_on_sha256;


--
-- Name: domain_user_post_favs_e621 fk_domain_user_post_favs_e621_post_id; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_post_favs_e621
    ADD CONSTRAINT fk_domain_user_post_favs_e621_post_id FOREIGN KEY (post_id) REFERENCES public.domain_posts_e621_aux(base_table_id);


--
-- Name: domain_user_post_favs_e621 fk_domain_user_post_favs_e621_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_post_favs_e621
    ADD CONSTRAINT fk_domain_user_post_favs_e621_user_id FOREIGN KEY (user_id) REFERENCES public.domain_users_e621_aux(base_table_id);


--
-- Name: domain_user_post_favs_fa fk_domain_user_post_favs_fa_post_id; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_post_favs_fa
    ADD CONSTRAINT fk_domain_user_post_favs_fa_post_id FOREIGN KEY (post_id) REFERENCES public.domain_posts(id);


--
-- Name: domain_user_post_favs_fa fk_domain_user_post_favs_fa_user_id; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_post_favs_fa
    ADD CONSTRAINT fk_domain_user_post_favs_fa_user_id FOREIGN KEY (user_id) REFERENCES public.domain_users(id);


--
-- Name: telegram_bot_logs fk_rails_001ca2ed89; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.telegram_bot_logs
    ADD CONSTRAINT fk_rails_001ca2ed89 FOREIGN KEY (processed_image_sha256) REFERENCES public.blob_files(sha256);


--
-- Name: domain_user_job_event_add_tracked_objects fk_rails_03ea351597; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_job_event_add_tracked_objects
    ADD CONSTRAINT fk_rails_03ea351597 FOREIGN KEY (user_id) REFERENCES public.domain_users(id);


--
-- Name: domain_users_bluesky_aux fk_rails_095a111783; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_users_bluesky_aux
    ADD CONSTRAINT fk_rails_095a111783 FOREIGN KEY (last_posts_scan_log_entry_id) REFERENCES public.http_log_entries(id);


--
-- Name: domain_users_fa_aux fk_rails_0d64d940cf; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_users_fa_aux
    ADD CONSTRAINT fk_rails_0d64d940cf FOREIGN KEY (base_table_id) REFERENCES public.domain_users(id);


--
-- Name: domain_user_job_event_add_tracked_objects fk_rails_0e1b667c4a; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_job_event_add_tracked_objects
    ADD CONSTRAINT fk_rails_0e1b667c4a FOREIGN KEY (log_entry_id) REFERENCES public.http_log_entries(id);


--
-- Name: domain_users_inkbunny_aux fk_rails_205f95e7f6; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_users_inkbunny_aux
    ADD CONSTRAINT fk_rails_205f95e7f6 FOREIGN KEY (shallow_update_log_entry_id) REFERENCES public.http_log_entries(id);


--
-- Name: domain_post_group_joins fk_rails_22154fb920; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_post_group_joins
    ADD CONSTRAINT fk_rails_22154fb920 FOREIGN KEY (post_id) REFERENCES public.domain_posts(id);


--
-- Name: domain_user_job_event_profile_scans fk_rails_26cf4d0529; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_job_event_profile_scans
    ADD CONSTRAINT fk_rails_26cf4d0529 FOREIGN KEY (log_entry_id) REFERENCES public.http_log_entries(id);


--
-- Name: domain_twitter_medias fk_rails_278c1d09f0; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_twitter_medias
    ADD CONSTRAINT fk_rails_278c1d09f0 FOREIGN KEY (tweet_id) REFERENCES public.domain_twitter_tweets(id);


--
-- Name: domain_posts_bluesky_aux fk_rails_2a2f4bfba8; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_posts_bluesky_aux
    ADD CONSTRAINT fk_rails_2a2f4bfba8 FOREIGN KEY (base_table_id) REFERENCES public.domain_posts(id);


--
-- Name: domain_users_inkbunny_aux fk_rails_304ea0307f; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_users_inkbunny_aux
    ADD CONSTRAINT fk_rails_304ea0307f FOREIGN KEY (base_table_id) REFERENCES public.domain_users(id);


--
-- Name: domain_user_job_event_follow_scans fk_rails_3641cc46f0; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_job_event_follow_scans
    ADD CONSTRAINT fk_rails_3641cc46f0 FOREIGN KEY (log_entry_id) REFERENCES public.http_log_entries(id);


--
-- Name: domain_posts_ib_aux fk_rails_3762390d41; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_posts_ib_aux
    ADD CONSTRAINT fk_rails_3762390d41 FOREIGN KEY (shallow_update_log_entry_id) REFERENCES public.http_log_entries(id);


--
-- Name: http_log_entries fk_rails_42f35e9da0; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.http_log_entries
    ADD CONSTRAINT fk_rails_42f35e9da0 FOREIGN KEY (response_headers_id) REFERENCES public.http_log_entry_headers(id);


--
-- Name: domain_post_files_bluesky_aux fk_rails_47e4648919; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_post_files_bluesky_aux
    ADD CONSTRAINT fk_rails_47e4648919 FOREIGN KEY (base_table_id) REFERENCES public.domain_post_files(id);


--
-- Name: domain_fa_fav_id_and_dates fk_rails_4ad7be007e; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_fa_fav_id_and_dates
    ADD CONSTRAINT fk_rails_4ad7be007e FOREIGN KEY (user_id) REFERENCES public.domain_users(id);


--
-- Name: domain_user_user_follows fk_rails_4b2ab65400; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_user_follows
    ADD CONSTRAINT fk_rails_4b2ab65400 FOREIGN KEY (from_id) REFERENCES public.domain_users(id);


--
-- Name: domain_posts_ib_aux fk_rails_5ee2c344bd; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_posts_ib_aux
    ADD CONSTRAINT fk_rails_5ee2c344bd FOREIGN KEY (deep_update_log_entry_id) REFERENCES public.http_log_entries(id);


--
-- Name: domain_twitter_medias fk_rails_5fffa41fa6; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_twitter_medias
    ADD CONSTRAINT fk_rails_5fffa41fa6 FOREIGN KEY (file_id) REFERENCES public.http_log_entries(id);


--
-- Name: domain_users_bluesky_aux fk_rails_673dd1243a; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_users_bluesky_aux
    ADD CONSTRAINT fk_rails_673dd1243a FOREIGN KEY (base_table_id) REFERENCES public.domain_users(id);


--
-- Name: domain_posts_bluesky_aux fk_rails_7393623916; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_posts_bluesky_aux
    ADD CONSTRAINT fk_rails_7393623916 FOREIGN KEY (first_seen_entry_id) REFERENCES public.http_log_entries(id);


--
-- Name: domain_posts_e621_aux fk_rails_73ac068c64; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_posts_e621_aux
    ADD CONSTRAINT fk_rails_73ac068c64 FOREIGN KEY (uploader_user_id) REFERENCES public.domain_users_e621_aux(base_table_id);


--
-- Name: domain_posts_e621_aux fk_rails_7deb1f0178; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_posts_e621_aux
    ADD CONSTRAINT fk_rails_7deb1f0178 FOREIGN KEY (scan_log_entry_id) REFERENCES public.http_log_entries(id);


--
-- Name: domain_users_fa_aux fk_rails_7e51f8bfbc; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_users_fa_aux
    ADD CONSTRAINT fk_rails_7e51f8bfbc FOREIGN KEY (last_gallery_page_id) REFERENCES public.http_log_entries(id);


--
-- Name: domain_post_files fk_rails_7eb6ae5fa3; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_post_files
    ADD CONSTRAINT fk_rails_7eb6ae5fa3 FOREIGN KEY (post_id) REFERENCES public.domain_posts(id);


--
-- Name: domain_user_search_names fk_rails_8475fe75b5; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_search_names
    ADD CONSTRAINT fk_rails_8475fe75b5 FOREIGN KEY (user_id) REFERENCES public.domain_users(id);


--
-- Name: domain_user_job_event_posts_scans fk_rails_94b2c9f6fb; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_job_event_posts_scans
    ADD CONSTRAINT fk_rails_94b2c9f6fb FOREIGN KEY (log_entry_id) REFERENCES public.http_log_entries(id);


--
-- Name: good_job_execution_log_lines_collections fk_rails_98c288034f; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.good_job_execution_log_lines_collections
    ADD CONSTRAINT fk_rails_98c288034f FOREIGN KEY (good_job_execution_id) REFERENCES public.good_job_executions(id) ON DELETE CASCADE;


--
-- Name: domain_user_post_creations fk_rails_9f4b85bc57; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_post_creations
    ADD CONSTRAINT fk_rails_9f4b85bc57 FOREIGN KEY (user_id) REFERENCES public.domain_users(id);


--
-- Name: domain_posts_e621_aux fk_rails_a90522803d; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_posts_e621_aux
    ADD CONSTRAINT fk_rails_a90522803d FOREIGN KEY (last_index_page_id) REFERENCES public.http_log_entries(id);


--
-- Name: domain_posts_e621_aux fk_rails_ae368c64c2; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_posts_e621_aux
    ADD CONSTRAINT fk_rails_ae368c64c2 FOREIGN KEY (base_table_id) REFERENCES public.domain_posts(id);


--
-- Name: domain_user_user_follows fk_rails_b45e6e3979; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_user_follows
    ADD CONSTRAINT fk_rails_b45e6e3979 FOREIGN KEY (to_id) REFERENCES public.domain_users(id);


--
-- Name: domain_post_files_inkbunny_aux fk_rails_b4f96e5241; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_post_files_inkbunny_aux
    ADD CONSTRAINT fk_rails_b4f96e5241 FOREIGN KEY (base_table_id) REFERENCES public.domain_post_files(id);


--
-- Name: domain_users_e621_aux fk_rails_b5bacbced6; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_users_e621_aux
    ADD CONSTRAINT fk_rails_b5bacbced6 FOREIGN KEY (base_table_id) REFERENCES public.domain_users(id);


--
-- Name: domain_posts_ib_aux fk_rails_b94b311254; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_posts_ib_aux
    ADD CONSTRAINT fk_rails_b94b311254 FOREIGN KEY (base_table_id) REFERENCES public.domain_posts(id);


--
-- Name: domain_user_job_event_profile_scans fk_rails_b9a4299a45; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_job_event_profile_scans
    ADD CONSTRAINT fk_rails_b9a4299a45 FOREIGN KEY (user_id) REFERENCES public.domain_users(id);


--
-- Name: domain_user_job_event_posts_scans fk_rails_ba009ed77e; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_job_event_posts_scans
    ADD CONSTRAINT fk_rails_ba009ed77e FOREIGN KEY (user_id) REFERENCES public.domain_users(id);


--
-- Name: domain_posts_fa_aux fk_rails_be2be2e955; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_posts_fa_aux
    ADD CONSTRAINT fk_rails_be2be2e955 FOREIGN KEY (base_table_id) REFERENCES public.domain_posts(id);


--
-- Name: domain_users_inkbunny_aux fk_rails_c2d597dcc4; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_users_inkbunny_aux
    ADD CONSTRAINT fk_rails_c2d597dcc4 FOREIGN KEY (deep_update_log_entry_id) REFERENCES public.http_log_entries(id);


--
-- Name: http_log_entries fk_rails_c5f7bcff78; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.http_log_entries
    ADD CONSTRAINT fk_rails_c5f7bcff78 FOREIGN KEY (caused_by_id) REFERENCES public.http_log_entries(id);


--
-- Name: domain_users_fa_aux fk_rails_c6ff2c94b5; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_users_fa_aux
    ADD CONSTRAINT fk_rails_c6ff2c94b5 FOREIGN KEY (last_user_page_id) REFERENCES public.http_log_entries(id);


--
-- Name: domain_user_post_favs fk_rails_c79733f291; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_post_favs
    ADD CONSTRAINT fk_rails_c79733f291 FOREIGN KEY (user_id) REFERENCES public.domain_users(id);


--
-- Name: domain_users_bluesky_aux fk_rails_cdeabf49ad; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_users_bluesky_aux
    ADD CONSTRAINT fk_rails_cdeabf49ad FOREIGN KEY (last_scan_log_entry_id) REFERENCES public.http_log_entries(id);


--
-- Name: domain_user_post_favs fk_rails_ce892be9a6; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_post_favs
    ADD CONSTRAINT fk_rails_ce892be9a6 FOREIGN KEY (post_id) REFERENCES public.domain_posts(id);


--
-- Name: http_log_entries fk_rails_cf47f64c57; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.http_log_entries
    ADD CONSTRAINT fk_rails_cf47f64c57 FOREIGN KEY (request_headers_id) REFERENCES public.http_log_entry_headers(id);


--
-- Name: domain_post_files fk_rails_d059c07f77; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_post_files
    ADD CONSTRAINT fk_rails_d059c07f77 FOREIGN KEY (log_entry_id) REFERENCES public.http_log_entries(id);


--
-- Name: domain_posts_e621_aux fk_rails_d691739802; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_posts_e621_aux
    ADD CONSTRAINT fk_rails_d691739802 FOREIGN KEY (caused_by_entry_id) REFERENCES public.http_log_entries(id);


--
-- Name: domain_user_job_event_follow_scans fk_rails_ea2f8b74ab; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_job_event_follow_scans
    ADD CONSTRAINT fk_rails_ea2f8b74ab FOREIGN KEY (user_id) REFERENCES public.domain_users(id);


--
-- Name: domain_post_group_joins fk_rails_eddd0a9390; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_post_group_joins
    ADD CONSTRAINT fk_rails_eddd0a9390 FOREIGN KEY (group_id) REFERENCES public.domain_post_groups(id);


--
-- Name: domain_user_post_creations fk_rails_f3c2231511; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_post_creations
    ADD CONSTRAINT fk_rails_f3c2231511 FOREIGN KEY (post_id) REFERENCES public.domain_posts(id);


--
-- Name: domain_user_avatars fk_rails_f89912a20f; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_user_avatars
    ADD CONSTRAINT fk_rails_f89912a20f FOREIGN KEY (user_id) REFERENCES public.domain_users(id);


--
-- Name: domain_twitter_tweets on_author_id; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.domain_twitter_tweets
    ADD CONSTRAINT on_author_id FOREIGN KEY (author_id) REFERENCES public.domain_twitter_users(tw_id);


--
-- PostgreSQL database dump complete
--

\unrestrict 4lxRvJkzFIK9U8uHyPKo1Wk4GuY4dImiyyJ2gX1hSlDMJnP2Tr19b1knRB5ODwJ

SET search_path TO "$user", public;

INSERT INTO "schema_migrations" (version) VALUES
('20250907183526'),
('20250820230131'),
('20250820215340'),
('20250820212318'),
('20250820210922'),
('20250820205149'),
('20250820204436'),
('20250820145726'),
('20250819012459'),
('20250819001506'),
('20250818235935'),
('20250818013611'),
('20250814202838'),
('20250814202723'),
('20250814202516'),
('20250814170820'),
('20250814165718'),
('20250814152837'),
('20250813190947'),
('20250813185746'),
('20250813185603'),
('20250813000020'),
('20250812215907'),
('20250812214902'),
('20250812214415'),
('20250812211640'),
('20250812182033'),
('20250811172839'),
('20250808004604'),
('20250805200056'),
('20250805191557'),
('20250805070115'),
('20250805070114'),
('20250805045947'),
('20250805044757'),
('20250731035548'),
('20250727173100'),
('20250726051748'),
('20250726051451'),
('20250725192431'),
('20250724213505'),
('20250723194407'),
('20250723193659'),
('20250722235434'),
('20250722153048'),
('20250722152949'),
('20250722060701'),
('20250722013801'),
('20250722010822'),
('20250722010327'),
('20250722005802'),
('20250722005417'),
('20250722005329'),
('20250722004928'),
('20250721193212'),
('20250721172316'),
('20250721171216'),
('20250718220223'),
('20250718195345'),
('20250718165332'),
('20250718162608'),
('20250717204152'),
('20250716164417'),
('20250711014943'),
('20250710204708'),
('20250709235107'),
('20250628000003'),
('20250628000002'),
('20250626191434'),
('20250619233027'),
('20250321050628'),
('20250310001341'),
('20250310001005'),
('20250306021628'),
('20250305195421'),
('20250302074924'),
('20250226003653'),
('20250222035939'),
('20250206224121'),
('20250203235035'),
('20250131060105'),
('20250131055824'),
('20250129174128'),
('20250129173329'),
('20250129061805'),
('20250129061217'),
('20250128142856'),
('20250128041904'),
('20250127184150'),
('20250127165909'),
('20250105193442'),
('20250104211454'),
('20250104211453'),
('20250102185501'),
('20250101014121'),
('20241231215756'),
('20241231212346'),
('20241231061234'),
('20241230220636'),
('20241230060212'),
('20241230005956'),
('20241230004356'),
('20241229001358'),
('20241227185335'),
('20241225183955'),
('20241224061643'),
('20241224060756'),
('20241223175146'),
('20241220174922'),
('20241219201430'),
('20241218190906'),
('20241217182130'),
('20241217182129'),
('20230826003811'),
('20230823002507'),
('20230822235459'),
('20230819011649'),
('20230819011648'),
('20230819011647'),
('20230819011646'),
('20230819011645'),
('20230523162724'),
('20230520001257'),
('20230520001225'),
('20230519233707'),
('20230519002300'),
('20230503042308'),
('20230407162751'),
('20230331023807'),
('20230330134212'),
('20230330130506'),
('20230330130323'),
('20230325124842'),
('20230312025949'),
('20230308044852'),
('20230306181250'),
('20230301013456'),
('20230226224331'),
('20230226224328'),
('20230226223215'),
('20230226062154'),
('20230224065330'),
('20230223010812'),
('20230222050313'),
('20230222045918'),
('20230220062108'),
('20230220055733'),
('20230220055132'),
('20230213013141'),
('20230207211826'),
('20230207210950'),
('20230207204901'),
('20230204023258'),
('20230204015222'),
('20230203222102'),
('20230131012417'),
('20230129050320'),
('0');

