diff --git a/.devcontainer/Dockerfile.devcontainer b/.devcontainer/Dockerfile.devcontainer index 2174465d..5cd027be 100644 --- a/.devcontainer/Dockerfile.devcontainer +++ b/.devcontainer/Dockerfile.devcontainer @@ -51,7 +51,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \ sudo apt update && \ sudo apt-get install --no-install-recommends --no-install-suggests -qqy \ - postgresql-client-15 + postgresql-client-17 # Install & configure delta diff tool RUN wget -O- https://github.com/dandavison/delta/releases/download/0.18.2/git-delta_0.18.2_amd64.deb > /tmp/git-delta.deb && \ diff --git a/.devcontainer/Dockerfile.postgres b/.devcontainer/Dockerfile.postgres index e981355e..95c64405 100644 --- a/.devcontainer/Dockerfile.postgres +++ b/.devcontainer/Dockerfile.postgres @@ -1,8 +1,7 @@ -FROM postgres:15 +FROM postgres:17 RUN apt-get update && apt-get install -y \ - postgresql-15-pgvector \ + postgresql-17-pgvector \ && rm -rf /var/lib/apt/lists/* -COPY create-tablespaces.bash /docker-entrypoint-initdb.d/00-create-tablespaces.bash -RUN echo "CREATE EXTENSION pgvector;" >> /docker-entrypoint-initdb.d/01-pgvector.sql +RUN echo "CREATE EXTENSION vector;" >> /docker-entrypoint-initdb.d/01-vector.sql diff --git a/.devcontainer/create-tablespaces.bash b/.devcontainer/create-tablespaces.bash deleted file mode 100755 index af9e72cc..00000000 --- a/.devcontainer/create-tablespaces.bash +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -ex - -mkdir -p /tablespaces/mirai -chown postgres:postgres /tablespaces/mirai -chmod 750 /tablespaces/mirai -psql -v ON_ERROR_STOP=1 \ - --username "$POSTGRES_USER" \ - --dbname "$POSTGRES_DB" \ - -c "CREATE TABLESPACE mirai LOCATION '/tablespaces/mirai'" diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 587c758b..3627f5de 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -23,8 +23,7 @@ services: dockerfile: Dockerfile.postgres restart: unless-stopped volumes: - - postgres-data:/var/lib/postgresql/data - - postgres-data-tablespaces:/tablespaces + - postgres-17-data:/var/lib/postgresql/data - ./create-db-user.sql:/docker-entrypoint-initdb.d/create-db-user.sql environment: POSTGRES_USER: postgres @@ -66,8 +65,7 @@ services: - devcontainer-redux-grafana-data:/var/lib/grafana volumes: - postgres-data: - postgres-data-tablespaces: + postgres-17-data: devcontainer-redux-gem-cache: devcontainer-redux-blob-files: devcontainer-redux-grafana-data: diff --git a/backlog/tasks/task-69 - Update-devcontainer-Dockerfile-based-on-has_aux_table-repo.md b/backlog/tasks/task-69 - Update-devcontainer-Dockerfile-based-on-has_aux_table-repo.md index 47bc455a..830eeee1 100644 --- a/backlog/tasks/task-69 - Update-devcontainer-Dockerfile-based-on-has_aux_table-repo.md +++ b/backlog/tasks/task-69 - Update-devcontainer-Dockerfile-based-on-has_aux_table-repo.md @@ -1,7 +1,7 @@ --- id: task-69 title: Update devcontainer Dockerfile based on has_aux_table repo -status: To Do +status: Done assignee: [] created_date: '2025-07-21' labels: [] diff --git a/config/database.yml b/config/database.yml index 75f349ba..7e5746e3 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,9 +1,3 @@ -# SQLite. Versions 3.8.0 and up are supported. -# gem install sqlite3 -# -# Ensure the SQLite 3 gem is defined in your Gemfile -# gem "sqlite3" -# default: &default adapter: sqlite3 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> @@ -28,9 +22,6 @@ redux_dev: &redux_dev adapter: postgresql host: db port: 5432 - # database: redux_development - # username: scraper_redux - # password: pdkFLqRmQwPUPaDDC4pX database: postgres username: postgres password: postgres @@ -41,8 +32,6 @@ local_redux_test: &local_redux_test host: db port: 5432 database: redux_test<%= ENV['TEST_ENV_NUMBER'] %> - # username: scraper_redux - # password: pdkFLqRmQwPUPaDDC4pX username: postgres password: postgres pool: 4 diff --git a/db/migrate/20250722060701_drop_indexed_posts.rb b/db/migrate/20250722060701_drop_indexed_posts.rb new file mode 100644 index 00000000..82ce3d0e --- /dev/null +++ b/db/migrate/20250722060701_drop_indexed_posts.rb @@ -0,0 +1,9 @@ +class DropIndexedPosts < ActiveRecord::Migration[7.2] + def up + drop_table :indexed_posts + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end diff --git a/db/migrate/20250722152949_migrate_everything_out_of_mirai.rb b/db/migrate/20250722152949_migrate_everything_out_of_mirai.rb new file mode 100644 index 00000000..28217581 --- /dev/null +++ b/db/migrate/20250722152949_migrate_everything_out_of_mirai.rb @@ -0,0 +1,17 @@ +class MigrateEverythingOutOfMirai < ActiveRecord::Migration[7.2] + def up + execute <<-SQL + ALTER TABLE ALL IN TABLESPACE mirai + SET tablespace pg_default; + SQL + + execute <<-SQL + ALTER INDEX ALL IN TABLESPACE mirai + SET tablespace pg_default; + SQL + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end diff --git a/db/migrate/20250722153048_drop_mirai_tablespace.rb b/db/migrate/20250722153048_drop_mirai_tablespace.rb new file mode 100644 index 00000000..644db271 --- /dev/null +++ b/db/migrate/20250722153048_drop_mirai_tablespace.rb @@ -0,0 +1,13 @@ +class DropMiraiTablespace < ActiveRecord::Migration[7.2] + disable_ddl_transaction! + + def up + execute <<-SQL + DROP TABLESPACE mirai; + SQL + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end diff --git a/db/structure.sql b/db/structure.sql index f97029b1..0ca1ac5b 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -1,6 +1,7 @@ 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); @@ -16,13 +17,6 @@ SET row_security = off; -- *not* creating schema, since initdb creates it --- --- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: - --- - -COMMENT ON SCHEMA public IS ''; - - -- -- Name: fuzzystrmatch; Type: EXTENSION; Schema: -; Owner: - -- @@ -182,8 +176,7 @@ CREATE TYPE public.domain_user_type AS ENUM ( CREATE TYPE public.postable_type AS ENUM ( 'Domain::Fa::Post', 'Domain::E621::Post', - 'Domain::Inkbunny::Post', - 'Domain::Sofurry::Post' + 'Domain::Inkbunny::Post' ); @@ -1114,10 +1107,8 @@ CREATE TABLE public.blob_files_63 ( ); -SET default_tablespace = mirai; - -- --- Name: domain_fa_fav_id_and_dates; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_fa_fav_id_and_dates; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_fa_fav_id_and_dates ( @@ -1150,8 +1141,6 @@ CREATE SEQUENCE public.domain_fa_fav_id_and_dates_id_seq ALTER SEQUENCE public.domain_fa_fav_id_and_dates_id_seq OWNED BY public.domain_fa_fav_id_and_dates.id; -SET default_tablespace = ''; - -- -- Name: domain_post_file_bit_fingerprints; Type: TABLE; Schema: public; Owner: - -- @@ -1219,10 +1208,8 @@ CREATE SEQUENCE public.domain_post_file_thumbnails_id_seq ALTER SEQUENCE public.domain_post_file_thumbnails_id_seq OWNED BY public.domain_post_file_thumbnails.id; -SET default_tablespace = mirai; - -- --- Name: domain_post_files; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_post_files; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_post_files ( @@ -1261,7 +1248,7 @@ ALTER SEQUENCE public.domain_post_files_id_seq OWNED BY public.domain_post_files -- --- Name: domain_post_files_inkbunny_aux; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_post_files_inkbunny_aux; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_post_files_inkbunny_aux ( @@ -1297,7 +1284,7 @@ ALTER SEQUENCE public.domain_post_files_inkbunny_aux_base_table_id_seq OWNED BY -- --- Name: domain_post_group_joins; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_post_group_joins; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_post_group_joins ( @@ -1311,7 +1298,7 @@ CREATE TABLE public.domain_post_group_joins ( -- --- Name: domain_post_groups; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_post_groups; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_post_groups ( @@ -1343,7 +1330,7 @@ ALTER SEQUENCE public.domain_post_groups_id_seq OWNED BY public.domain_post_grou -- --- Name: domain_posts; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_posts; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_posts ( @@ -1376,7 +1363,7 @@ ALTER SEQUENCE public.domain_posts_id_seq OWNED BY public.domain_posts.id; -- --- Name: domain_twitter_medias; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_twitter_medias; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_twitter_medias ( @@ -1393,7 +1380,7 @@ CREATE TABLE public.domain_twitter_medias ( -- --- Name: domain_twitter_tweets; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_twitter_tweets; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_twitter_tweets ( @@ -1430,7 +1417,7 @@ ALTER SEQUENCE public.domain_twitter_tweets_id_seq OWNED BY public.domain_twitte -- --- Name: domain_twitter_user_versions; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_twitter_user_versions; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_twitter_user_versions ( @@ -1463,7 +1450,7 @@ ALTER SEQUENCE public.domain_twitter_user_versions_id_seq OWNED BY public.domain -- --- Name: domain_twitter_users; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_twitter_users; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_twitter_users ( @@ -1505,7 +1492,7 @@ ALTER SEQUENCE public.domain_twitter_users_id_seq OWNED BY public.domain_twitter -- --- Name: domain_user_avatars; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_user_avatars; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_user_avatars ( @@ -1537,7 +1524,7 @@ ALTER SEQUENCE public.domain_user_avatars_id_seq OWNED BY public.domain_user_ava -- --- Name: domain_user_job_event_add_tracked_objects; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_user_job_event_add_tracked_objects; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_user_job_event_add_tracked_objects ( @@ -1574,7 +1561,7 @@ ALTER SEQUENCE public.domain_user_job_event_add_tracked_objects_id_seq OWNED BY -- --- Name: domain_user_post_creations; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_user_post_creations; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_user_post_creations ( @@ -1584,31 +1571,27 @@ CREATE TABLE public.domain_user_post_creations ( -- --- Name: domain_user_post_fav_post_factors; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_user_post_fav_post_factors; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_user_post_fav_post_factors ( - post_id bigint NOT NULL, - embedding public.vector(32), - created_at timestamp(6) without time zone NOT NULL, - updated_at timestamp(6) without time zone NOT NULL + post_id bigint, + embedding public.vector(32) ); -- --- Name: domain_user_post_fav_user_factors; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_user_post_fav_user_factors; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_user_post_fav_user_factors ( - user_id bigint NOT NULL, - embedding public.vector(32), - created_at timestamp(6) without time zone NOT NULL, - updated_at timestamp(6) without time zone NOT NULL + user_id bigint, + embedding public.vector(32) ); -- --- Name: domain_user_post_favs; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_user_post_favs; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_user_post_favs ( @@ -1617,11 +1600,12 @@ CREATE TABLE public.domain_user_post_favs ( 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_search_names; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_user_search_names; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_user_search_names ( @@ -1653,31 +1637,27 @@ ALTER SEQUENCE public.domain_user_search_names_id_seq OWNED BY public.domain_use -- --- Name: domain_user_user_follow_from_factors; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_user_user_follow_from_factors; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_user_user_follow_from_factors ( - user_id bigint NOT NULL, - embedding public.vector(32), - created_at timestamp(6) without time zone NOT NULL, - updated_at timestamp(6) without time zone NOT NULL + user_id bigint, + embedding public.vector(32) ); -- --- Name: domain_user_user_follow_to_factors; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_user_user_follow_to_factors; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_user_user_follow_to_factors ( - user_id bigint NOT NULL, - embedding public.vector(32), - created_at timestamp(6) without time zone NOT NULL, - updated_at timestamp(6) without time zone NOT NULL + user_id bigint, + embedding public.vector(32) ); -- --- Name: domain_user_user_follows; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_user_user_follows; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_user_user_follows ( @@ -1687,7 +1667,7 @@ CREATE TABLE public.domain_user_user_follows ( -- --- Name: domain_users; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_users; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_users ( @@ -1704,7 +1684,7 @@ CREATE TABLE public.domain_users ( -- --- Name: domain_users_e621_aux; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_users_e621_aux; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_users_e621_aux ( @@ -1738,7 +1718,7 @@ ALTER SEQUENCE public.domain_users_e621_aux_base_table_id_seq OWNED BY public.do -- --- Name: domain_users_fa_aux; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_users_fa_aux; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_users_fa_aux ( @@ -1812,7 +1792,7 @@ ALTER SEQUENCE public.domain_users_id_seq OWNED BY public.domain_users.id; -- --- Name: domain_users_inkbunny_aux; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_users_inkbunny_aux; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_users_inkbunny_aux ( @@ -1846,8 +1826,6 @@ CREATE SEQUENCE public.domain_users_inkbunny_aux_base_table_id_seq ALTER SEQUENCE public.domain_users_inkbunny_aux_base_table_id_seq OWNED BY public.domain_users_inkbunny_aux.base_table_id; -SET default_tablespace = ''; - -- -- Name: global_states; Type: TABLE; Schema: public; Owner: - -- @@ -1881,10 +1859,8 @@ CREATE SEQUENCE public.global_states_id_seq ALTER SEQUENCE public.global_states_id_seq OWNED BY public.global_states.id; -SET default_tablespace = mirai; - -- --- Name: good_job_batches; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: good_job_batches; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.good_job_batches ( @@ -1904,8 +1880,6 @@ CREATE TABLE public.good_job_batches ( ); -SET default_tablespace = ''; - -- -- Name: good_job_execution_log_lines_collections; Type: TABLE; Schema: public; Owner: - -- @@ -1938,10 +1912,8 @@ CREATE SEQUENCE public.good_job_execution_log_lines_collections_id_seq ALTER SEQUENCE public.good_job_execution_log_lines_collections_id_seq OWNED BY public.good_job_execution_log_lines_collections.id; -SET default_tablespace = mirai; - -- --- Name: good_job_executions; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: good_job_executions; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.good_job_executions ( @@ -1963,7 +1935,7 @@ CREATE TABLE public.good_job_executions ( -- --- Name: good_job_processes; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: good_job_processes; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.good_job_processes ( @@ -1976,7 +1948,7 @@ CREATE TABLE public.good_job_processes ( -- --- Name: good_job_settings; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: good_job_settings; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.good_job_settings ( @@ -1989,7 +1961,7 @@ CREATE TABLE public.good_job_settings ( -- --- Name: good_jobs; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: good_jobs; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.good_jobs ( @@ -2021,7 +1993,7 @@ CREATE TABLE public.good_jobs ( -- --- Name: http_log_entries; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: http_log_entries; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.http_log_entries ( @@ -2066,7 +2038,7 @@ ALTER SEQUENCE public.http_log_entries_id_seq OWNED BY public.http_log_entries.i -- --- Name: http_log_entry_headers; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: http_log_entry_headers; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.http_log_entry_headers ( @@ -2097,41 +2069,6 @@ CREATE SEQUENCE public.http_log_entry_headers_id_seq ALTER SEQUENCE public.http_log_entry_headers_id_seq OWNED BY public.http_log_entry_headers.id; --- --- Name: indexed_posts; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai --- - -CREATE TABLE public.indexed_posts ( - id bigint NOT NULL, - postable_id integer NOT NULL, - created_at timestamp(6) without time zone NOT NULL, - updated_at timestamp(6) without time zone NOT NULL, - postable_type public.postable_type NOT NULL, - posted_at timestamp(6) without time zone -); - - --- --- Name: indexed_posts_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.indexed_posts_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: indexed_posts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.indexed_posts_id_seq OWNED BY public.indexed_posts.id; - - -SET default_tablespace = ''; - -- -- Name: ip_address_roles; Type: TABLE; Schema: public; Owner: - -- @@ -2166,10 +2103,8 @@ CREATE SEQUENCE public.ip_address_roles_id_seq ALTER SEQUENCE public.ip_address_roles_id_seq OWNED BY public.ip_address_roles.id; -SET default_tablespace = mirai; - -- --- Name: pghero_query_stats; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: pghero_query_stats; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.pghero_query_stats ( @@ -2204,7 +2139,7 @@ ALTER SEQUENCE public.pghero_query_stats_id_seq OWNED BY public.pghero_query_sta -- --- Name: pghero_space_stats; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: pghero_space_stats; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.pghero_space_stats ( @@ -2236,8 +2171,6 @@ CREATE SEQUENCE public.pghero_space_stats_id_seq ALTER SEQUENCE public.pghero_space_stats_id_seq OWNED BY public.pghero_space_stats.id; -SET default_tablespace = ''; - -- -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: - -- @@ -2247,10 +2180,8 @@ CREATE TABLE public.schema_migrations ( ); -SET default_tablespace = mirai; - -- --- Name: trained_regression_models; Type: TABLE; Schema: public; Owner: -; Tablespace: mirai +-- Name: trained_regression_models; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.trained_regression_models ( @@ -2297,8 +2228,6 @@ CREATE SEQUENCE public.trained_regression_models_id_seq ALTER SEQUENCE public.trained_regression_models_id_seq OWNED BY public.trained_regression_models.id; -SET default_tablespace = ''; - -- -- Name: users; Type: TABLE; Schema: public; Owner: - -- @@ -2935,13 +2864,6 @@ ALTER TABLE ONLY public.http_log_entries ALTER COLUMN id SET DEFAULT nextval('pu ALTER TABLE ONLY public.http_log_entry_headers ALTER COLUMN id SET DEFAULT nextval('public.http_log_entry_headers_id_seq'::regclass); --- --- Name: indexed_posts id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.indexed_posts ALTER COLUMN id SET DEFAULT nextval('public.indexed_posts_id_seq'::regclass); - - -- -- Name: ip_address_roles id; Type: DEFAULT; Schema: public; Owner: - -- @@ -2977,10 +2899,8 @@ ALTER TABLE ONLY public.trained_regression_models ALTER COLUMN id SET DEFAULT ne ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass); -SET default_tablespace = mirai; - -- --- Name: ar_internal_metadata ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- Name: ar_internal_metadata ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.ar_internal_metadata @@ -2988,15 +2908,13 @@ ALTER TABLE ONLY public.ar_internal_metadata -- --- Name: domain_fa_fav_id_and_dates domain_fa_fav_id_and_dates_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- 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); -SET default_tablespace = ''; - -- -- Name: domain_post_file_bit_fingerprints domain_post_file_bit_fingerprints_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -3013,10 +2931,8 @@ ALTER TABLE ONLY public.domain_post_file_thumbnails ADD CONSTRAINT domain_post_file_thumbnails_pkey PRIMARY KEY (id); -SET default_tablespace = mirai; - -- --- Name: domain_post_files_inkbunny_aux domain_post_files_inkbunny_aux_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- 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 @@ -3024,7 +2940,7 @@ ALTER TABLE ONLY public.domain_post_files_inkbunny_aux -- --- Name: domain_post_files domain_post_files_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_post_files domain_post_files_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_post_files @@ -3032,7 +2948,7 @@ ALTER TABLE ONLY public.domain_post_files -- --- Name: domain_post_groups domain_post_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_post_groups domain_post_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_post_groups @@ -3040,7 +2956,7 @@ ALTER TABLE ONLY public.domain_post_groups -- --- Name: domain_posts domain_posts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_posts domain_posts_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_posts @@ -3048,7 +2964,7 @@ ALTER TABLE ONLY public.domain_posts -- --- Name: domain_twitter_tweets domain_twitter_tweets_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_twitter_tweets domain_twitter_tweets_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_twitter_tweets @@ -3056,7 +2972,7 @@ ALTER TABLE ONLY public.domain_twitter_tweets -- --- Name: domain_twitter_user_versions domain_twitter_user_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_twitter_user_versions domain_twitter_user_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_twitter_user_versions @@ -3064,7 +2980,7 @@ ALTER TABLE ONLY public.domain_twitter_user_versions -- --- Name: domain_twitter_users domain_twitter_users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_twitter_users domain_twitter_users_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_twitter_users @@ -3072,7 +2988,7 @@ ALTER TABLE ONLY public.domain_twitter_users -- --- Name: domain_user_avatars domain_user_avatars_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_user_avatars domain_user_avatars_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_user_avatars @@ -3080,7 +2996,7 @@ ALTER TABLE ONLY public.domain_user_avatars -- --- Name: domain_user_job_event_add_tracked_objects domain_user_job_event_add_tracked_objects_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- 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 @@ -3088,7 +3004,7 @@ ALTER TABLE ONLY public.domain_user_job_event_add_tracked_objects -- --- Name: domain_user_search_names domain_user_search_names_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_user_search_names domain_user_search_names_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_user_search_names @@ -3096,7 +3012,7 @@ ALTER TABLE ONLY public.domain_user_search_names -- --- Name: domain_users_e621_aux domain_users_e621_aux_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_users_e621_aux domain_users_e621_aux_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_users_e621_aux @@ -3104,7 +3020,7 @@ ALTER TABLE ONLY public.domain_users_e621_aux -- --- Name: domain_users_fa_aux domain_users_fa_aux_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_users_fa_aux domain_users_fa_aux_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_users_fa_aux @@ -3112,7 +3028,7 @@ ALTER TABLE ONLY public.domain_users_fa_aux -- --- Name: domain_users_inkbunny_aux domain_users_inkbunny_aux_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- Name: domain_users_inkbunny_aux domain_users_inkbunny_aux_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_users_inkbunny_aux @@ -3120,15 +3036,13 @@ ALTER TABLE ONLY public.domain_users_inkbunny_aux -- --- Name: domain_users domain_users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- 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); -SET default_tablespace = ''; - -- -- Name: global_states global_states_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -3137,18 +3051,14 @@ ALTER TABLE ONLY public.global_states ADD CONSTRAINT global_states_pkey PRIMARY KEY (id); -SET default_tablespace = mirai; - -- --- Name: good_job_batches good_job_batches_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- 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); -SET default_tablespace = ''; - -- -- Name: good_job_execution_log_lines_collections good_job_execution_log_lines_collections_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -3157,10 +3067,8 @@ ALTER TABLE ONLY public.good_job_execution_log_lines_collections ADD CONSTRAINT good_job_execution_log_lines_collections_pkey PRIMARY KEY (id); -SET default_tablespace = mirai; - -- --- Name: good_job_executions good_job_executions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- Name: good_job_executions good_job_executions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.good_job_executions @@ -3168,7 +3076,7 @@ ALTER TABLE ONLY public.good_job_executions -- --- Name: good_job_processes good_job_processes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- Name: good_job_processes good_job_processes_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.good_job_processes @@ -3176,7 +3084,7 @@ ALTER TABLE ONLY public.good_job_processes -- --- Name: good_job_settings good_job_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- Name: good_job_settings good_job_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.good_job_settings @@ -3184,7 +3092,7 @@ ALTER TABLE ONLY public.good_job_settings -- --- Name: good_jobs good_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- Name: good_jobs good_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.good_jobs @@ -3192,7 +3100,7 @@ ALTER TABLE ONLY public.good_jobs -- --- Name: http_log_entries http_log_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- Name: http_log_entries http_log_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.http_log_entries @@ -3200,23 +3108,13 @@ ALTER TABLE ONLY public.http_log_entries -- --- Name: http_log_entry_headers http_log_entry_headers_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- 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); -SET default_tablespace = ''; - --- --- Name: indexed_posts indexed_posts_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.indexed_posts - ADD CONSTRAINT indexed_posts_pkey PRIMARY KEY (id); - - -- -- Name: ip_address_roles ip_address_roles_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -3225,10 +3123,8 @@ ALTER TABLE ONLY public.ip_address_roles ADD CONSTRAINT ip_address_roles_pkey PRIMARY KEY (id); -SET default_tablespace = mirai; - -- --- Name: pghero_query_stats pghero_query_stats_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- Name: pghero_query_stats pghero_query_stats_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.pghero_query_stats @@ -3236,7 +3132,7 @@ ALTER TABLE ONLY public.pghero_query_stats -- --- Name: pghero_space_stats pghero_space_stats_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- Name: pghero_space_stats pghero_space_stats_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.pghero_space_stats @@ -3244,7 +3140,7 @@ ALTER TABLE ONLY public.pghero_space_stats -- --- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.schema_migrations @@ -3252,15 +3148,13 @@ ALTER TABLE ONLY public.schema_migrations -- --- Name: trained_regression_models trained_regression_models_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: mirai +-- 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); -SET default_tablespace = ''; - -- -- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -3269,157 +3163,181 @@ ALTER TABLE ONLY public.users ADD CONSTRAINT users_pkey PRIMARY KEY (id); -SET default_tablespace = mirai; +-- +-- Name: domain_user_post_fav_post_factors_hnsw_l2_ops; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX domain_user_post_fav_post_factors_hnsw_l2_ops ON public.domain_user_post_fav_post_factors USING hnsw (embedding public.vector_l2_ops) WITH (m='16', ef_construction='64'); + -- --- Name: idx_domain_e621_posts_on_e621_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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_user_post_favs_on_explicit_time; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- Name: idx_domain_user_post_favs_on_explicit_time; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_domain_user_post_favs_on_explicit_time ON public.domain_user_post_favs USING btree ((((json_attributes ->> 'explicit_time'::text))::integer)) WHERE (type = 'Domain::UserPostFav::FaUserPostFav'::public.domain_user_post_fav_type); -- --- Name: idx_domain_user_post_favs_on_fav_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- Name: idx_domain_user_post_favs_on_fav_id; Type: INDEX; Schema: public; Owner: - -- CREATE UNIQUE INDEX idx_domain_user_post_favs_on_fav_id ON public.domain_user_post_favs USING btree ((((json_attributes ->> 'fav_id'::text))::integer)) WHERE (type = 'Domain::UserPostFav::FaUserPostFav'::public.domain_user_post_fav_type); -- --- Name: idx_domain_user_post_favs_on_inferred_time; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- Name: idx_domain_user_post_favs_on_inferred_time; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX idx_domain_user_post_favs_on_inferred_time ON public.domain_user_post_favs USING btree ((((json_attributes ->> 'inferred_time'::text))::integer)) WHERE (type = 'Domain::UserPostFav::FaUserPostFav'::public.domain_user_post_fav_type); -- --- Name: idx_domain_users_e621_on_name_lower; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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); -SET default_tablespace = ''; - -- -- Name: idx_on_good_job_execution_id_685ddb5560; Type: INDEX; Schema: public; Owner: - -- @@ -3427,24 +3345,20 @@ SET default_tablespace = ''; CREATE UNIQUE INDEX idx_on_good_job_execution_id_685ddb5560 ON public.good_job_execution_log_lines_collections USING btree (good_job_execution_id); -SET default_tablespace = mirai; - -- --- Name: idx_on_kind_user_id_0795b93670; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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); -SET default_tablespace = ''; - -- -- Name: idx_on_post_file_id_thumb_type_frame_17152086d1; Type: INDEX; Schema: public; Owner: - -- @@ -3914,441 +3828,426 @@ CREATE UNIQUE INDEX index_blob_files_62_on_sha256 ON public.blob_files_62 USING CREATE UNIQUE INDEX index_blob_files_63_on_sha256 ON public.blob_files_63 USING btree (sha256); -SET default_tablespace = mirai; - -- --- Name: index_domain_fa_fav_id_and_dates_on_fav_fa_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- 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; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- Name: index_domain_fa_fav_id_and_dates_on_user_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_domain_fa_fav_id_and_dates_on_user_id ON public.domain_fa_fav_id_and_dates USING btree (user_id); -- --- Name: index_domain_fa_fav_id_and_dates_on_user_id_and_post_fa_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- 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); -SET default_tablespace = ''; - -- --- Name: index_domain_post_file_bit_fingerprints_on_fingerprint_value; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_domain_post_file_bit_fingerprints_on_fingerprint_value ON public.domain_post_file_bit_fingerprints USING hnsw (fingerprint_value public.bit_hamming_ops); - - -SET default_tablespace = mirai; - --- --- Name: index_domain_post_files_inkbunny_aux_on_base_table_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- Name: index_domain_post_files_inkbunny_aux_on_base_table_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_domain_post_files_inkbunny_aux_on_base_table_id ON public.domain_post_files_inkbunny_aux USING btree (base_table_id); -- --- Name: index_domain_post_files_inkbunny_aux_on_ib_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- 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_blob_sha256; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- Name: index_domain_post_files_on_blob_sha256; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_domain_post_files_on_blob_sha256 ON public.domain_post_files USING btree (blob_sha256); -- --- Name: index_domain_post_files_on_log_entry_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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_on_posted_at; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- 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_type; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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_post_creations_on_post_id_and_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai --- - -CREATE INDEX index_domain_user_post_fav_post_factors_on_embedding ON public.domain_user_post_fav_post_factors USING ivfflat (embedding); - - --- --- Name: index_domain_user_post_fav_post_factors_on_post_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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_on_post_id_and_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- Name: index_domain_user_search_names_on_user_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_domain_user_search_names_on_user_id ON public.domain_user_search_names USING btree (user_id); -- --- Name: index_domain_user_search_names_on_user_id_and_name; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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); +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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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 ivfflat (embedding); +CREATE INDEX index_domain_user_user_follow_to_factors_on_embedding ON public.domain_user_user_follow_to_factors USING ivfflat (embedding public.vector_cosine_ops) WITH (lists='5000'); -- --- Name: index_domain_user_user_follow_to_factors_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- Name: index_domain_user_user_follow_to_factors_on_embedding_hnsw; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_domain_user_user_follow_to_factors_on_embedding_hnsw 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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_e621_aux_on_base_table_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- Name: index_domain_users_e621_aux_on_base_table_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_domain_users_e621_aux_on_base_table_id ON public.domain_users_e621_aux USING btree (base_table_id); -- --- Name: index_domain_users_e621_aux_on_e621_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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_base_table_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- Name: index_domain_users_fa_aux_on_base_table_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_domain_users_fa_aux_on_base_table_id ON public.domain_users_fa_aux USING btree (base_table_id); -- --- Name: index_domain_users_fa_aux_on_full_name; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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_base_table_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- Name: index_domain_users_inkbunny_aux_on_base_table_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_domain_users_inkbunny_aux_on_base_table_id ON public.domain_users_inkbunny_aux USING btree (base_table_id); -- --- Name: index_domain_users_inkbunny_aux_on_deep_update_log_entry_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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); -SET default_tablespace = ''; - -- -- Name: index_global_states_on_key; Type: INDEX; Schema: public; Owner: - -- @@ -4356,192 +4255,167 @@ SET default_tablespace = ''; CREATE UNIQUE INDEX index_global_states_on_key ON public.global_states USING btree (key); -SET default_tablespace = mirai; - -- --- Name: index_good_job_executions_on_active_job_id_and_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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_request_headers_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- Name: index_http_log_entries_on_request_headers_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_http_log_entries_on_request_headers_id ON public.http_log_entries USING btree (request_headers_id); -- --- Name: index_http_log_entries_on_response_headers_id; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- Name: index_http_log_entries_on_response_headers_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_http_log_entries_on_response_headers_id ON public.http_log_entries USING btree (response_headers_id); -- --- Name: index_http_log_entries_on_response_sha256; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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_indexed_posts_on_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai --- - -CREATE INDEX index_indexed_posts_on_created_at ON public.indexed_posts USING btree (created_at); - - --- --- Name: index_indexed_posts_on_postable_id_and_postable_type; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai --- - -CREATE UNIQUE INDEX index_indexed_posts_on_postable_id_and_postable_type ON public.indexed_posts USING btree (postable_id, postable_type); - - -SET default_tablespace = ''; - --- --- Name: index_indexed_posts_on_posted_at; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_indexed_posts_on_posted_at ON public.indexed_posts USING btree (posted_at); - - -- -- Name: index_ip_address_roles_on_ip_address; Type: INDEX; Schema: public; Owner: - -- @@ -4549,59 +4423,55 @@ CREATE INDEX index_indexed_posts_on_posted_at ON public.indexed_posts USING btre CREATE UNIQUE INDEX index_ip_address_roles_on_ip_address ON public.ip_address_roles USING btree (ip_address); -SET default_tablespace = mirai; - -- --- Name: index_pghero_query_stats_on_database_and_captured_at; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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_trained_regression_models_on_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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: -; Tablespace: mirai +-- 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); -SET default_tablespace = ''; - -- -- Name: index_users_on_email; Type: INDEX; Schema: public; Owner: - -- @@ -4616,13 +4486,18 @@ CREATE UNIQUE INDEX index_users_on_email ON public.users USING btree (email); CREATE UNIQUE INDEX index_users_on_reset_password_token ON public.users USING btree (reset_password_token); -SET default_tablespace = mirai; - -- --- Name: ivfflat_index_on_fingerprint_value; Type: INDEX; Schema: public; Owner: -; Tablespace: mirai +-- 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='20000'); +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); -- @@ -5161,14 +5036,6 @@ ALTER TABLE ONLY public.domain_twitter_medias ADD CONSTRAINT fk_rails_5fffa41fa6 FOREIGN KEY (file_id) REFERENCES public.http_log_entries(id); --- --- Name: domain_user_user_follow_to_factors fk_rails_75a659b96f; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.domain_user_user_follow_to_factors - ADD CONSTRAINT fk_rails_75a659b96f FOREIGN KEY (user_id) REFERENCES public.domain_users(id); - - -- -- Name: domain_users_fa_aux fk_rails_7e51f8bfbc; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -5185,14 +5052,6 @@ ALTER TABLE ONLY public.domain_post_files ADD CONSTRAINT fk_rails_7eb6ae5fa3 FOREIGN KEY (post_id) REFERENCES public.domain_posts(id); --- --- Name: domain_user_user_follow_from_factors fk_rails_83aa0dfb3a; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.domain_user_user_follow_from_factors - ADD CONSTRAINT fk_rails_83aa0dfb3a FOREIGN KEY (user_id) REFERENCES public.domain_users(id); - - -- -- Name: domain_user_search_names fk_rails_8475fe75b5; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -5217,22 +5076,6 @@ ALTER TABLE ONLY public.domain_user_post_creations ADD CONSTRAINT fk_rails_9f4b85bc57 FOREIGN KEY (user_id) REFERENCES public.domain_users(id); --- --- Name: domain_user_post_fav_post_factors fk_rails_a305b823b2; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.domain_user_post_fav_post_factors - ADD CONSTRAINT fk_rails_a305b823b2 FOREIGN KEY (post_id) REFERENCES public.domain_posts(id); - - --- --- Name: domain_user_post_fav_user_factors fk_rails_a719707033; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.domain_user_post_fav_user_factors - ADD CONSTRAINT fk_rails_a719707033 FOREIGN KEY (user_id) REFERENCES public.domain_users(id); - - -- -- Name: domain_user_user_follows fk_rails_b45e6e3979; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -5352,6 +5195,9 @@ ALTER TABLE ONLY public.domain_twitter_tweets SET search_path TO "$user", public; INSERT INTO "schema_migrations" (version) VALUES +('20250722153048'), +('20250722152949'), +('20250722060701'), ('20250722013801'), ('20250722010822'), ('20250722010327'),