separate migration for user_post_favs_fa table indexes

This commit is contained in:
Dylan Knutson
2025-08-19 15:53:44 +00:00
parent 4830a4ce54
commit d2789f47dc
5 changed files with 20 additions and 8 deletions

View File

@@ -21,11 +21,6 @@ class CreateDomainUserPostFavsFa < ActiveRecord::Migration[7.2]
t.boolean :removed, null: false, default: false
t.datetime :explicit_time
t.datetime :inferred_time
t.index %i[user_id post_id], unique: true
t.index %i[user_id fa_fav_id]
t.index %i[post_id user_id]
t.index %i[fa_fav_id], unique: true
end
end
end

View File

@@ -23,7 +23,6 @@ class MigrateDomainUserPostFavsFa < ActiveRecord::Migration[7.2]
to_timestamp((json_attributes->>'inferred_time')::integer) as inferred_time
FROM domain_user_post_favs
WHERE type = 'Domain::UserPostFav::FaUserPostFav'
ON CONFLICT (user_id, post_id) DO NOTHING
SQL
end
end

View File

@@ -0,0 +1,14 @@
# typed: strict
# frozen_string_literal: true
class AddIndexesToUserPostFavsFa < ActiveRecord::Migration[7.2]
sig { void }
def change
change_table :domain_user_post_favs_fa do |t|
t.index %i[user_id post_id], unique: true
t.index %i[user_id fa_fav_id]
t.index %i[post_id user_id]
t.index %i[fa_fav_id], unique: true
end
end
end

View File

@@ -1,4 +1,4 @@
\restrict KVwJHYeb0aiqQld3jGGbHGfD5KiqX3RII26U2Hcgs4ak83J67dMbWwZAAsCuZRh
\restrict M2vzhnOdFSJ3FdEc5CUTZFy6hlZAYKe2pY8nWNsQNVQUOuVrSc4yVheBevgryE1
-- 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)
@@ -6084,11 +6084,12 @@ ALTER TABLE ONLY public.domain_twitter_tweets
-- PostgreSQL database dump complete
--
\unrestrict KVwJHYeb0aiqQld3jGGbHGfD5KiqX3RII26U2Hcgs4ak83J67dMbWwZAAsCuZRh
\unrestrict M2vzhnOdFSJ3FdEc5CUTZFy6hlZAYKe2pY8nWNsQNVQUOuVrSc4yVheBevgryE1
SET search_path TO "$user", public;
INSERT INTO "schema_migrations" (version) VALUES
('20250819012459'),
('20250819001506'),
('20250818235935'),
('20250818013611'),

View File

@@ -13,6 +13,9 @@ module BlueskyRakeHelpers
sig { params(did: String).returns(T.nilable(String)) }
def self.resolve_handle(did)
DIDKit::Resolver.new.resolve_did(did).get_validated_handle
rescue OpenURI::HTTPError => e
return nil if e.message == "404 Not Found"
raise
end
sig do