unique index on ib_id inkbunny posts

This commit is contained in:
Dylan Knutson
2025-09-08 02:28:24 +00:00
parent 7f7728366b
commit fa94d90474
2 changed files with 18 additions and 3 deletions

View File

@@ -0,0 +1,14 @@
class AddUniqueIndexToInkbunnyPostIbId < ActiveRecord::Migration[7.2]
def change
add_index :domain_posts_ib_aux,
:ib_id,
name: "index_domain_posts_ib_aux_on_ib_id_unique",
unique: true
remove_index :domain_posts_ib_aux,
:ib_id,
name: "index_domain_posts_ib_aux_on_ib_id"
rename_index :domain_posts_ib_aux,
"index_domain_posts_ib_aux_on_ib_id_unique",
"index_domain_posts_ib_aux_on_ib_id"
end
end

View File

@@ -1,4 +1,4 @@
\restrict 7TzA6fck7UXmbJ75eMoJZOwzcgQ2b4cZTq1JfFKiTdNPzDaeWqx6fddlLy7O3Jz
\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)
@@ -4589,7 +4589,7 @@ CREATE UNIQUE INDEX index_domain_posts_fa_aux_on_fa_id ON public.domain_posts_fa
-- Name: index_domain_posts_ib_aux_on_ib_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_domain_posts_ib_aux_on_ib_id ON public.domain_posts_ib_aux USING btree (ib_id);
CREATE UNIQUE INDEX index_domain_posts_ib_aux_on_ib_id ON public.domain_posts_ib_aux USING btree (ib_id);
--
@@ -6129,11 +6129,12 @@ ALTER TABLE ONLY public.domain_twitter_tweets
-- PostgreSQL database dump complete
--
\unrestrict 7TzA6fck7UXmbJ75eMoJZOwzcgQ2b4cZTq1JfFKiTdNPzDaeWqx6fddlLy7O3Jz
\unrestrict 4lxRvJkzFIK9U8uHyPKo1Wk4GuY4dImiyyJ2gX1hSlDMJnP2Tr19b1knRB5ODwJ
SET search_path TO "$user", public;
INSERT INTO "schema_migrations" (version) VALUES
('20250907183526'),
('20250820230131'),
('20250820215340'),
('20250820212318'),