diff --git a/db/migrate/20250818235935_create_domain_user_post_favs_fa.rb b/db/migrate/20250818235935_create_domain_user_post_favs_fa.rb index cc45deb7..1e686c81 100644 --- a/db/migrate/20250818235935_create_domain_user_post_favs_fa.rb +++ b/db/migrate/20250818235935_create_domain_user_post_favs_fa.rb @@ -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 diff --git a/db/migrate/20250819001506_migrate_domain_user_post_favs_fa.rb b/db/migrate/20250819001506_migrate_domain_user_post_favs_fa.rb index a5595c17..bf9cfc94 100644 --- a/db/migrate/20250819001506_migrate_domain_user_post_favs_fa.rb +++ b/db/migrate/20250819001506_migrate_domain_user_post_favs_fa.rb @@ -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 diff --git a/db/migrate/20250819012459_add_indexes_to_user_post_favs_fa.rb b/db/migrate/20250819012459_add_indexes_to_user_post_favs_fa.rb new file mode 100644 index 00000000..03f1171f --- /dev/null +++ b/db/migrate/20250819012459_add_indexes_to_user_post_favs_fa.rb @@ -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 diff --git a/db/structure.sql b/db/structure.sql index 12882ab0..0f6e047b 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -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'), diff --git a/rake/bluesky.rake b/rake/bluesky.rake index ff3da7f3..779137a2 100644 --- a/rake/bluesky.rake +++ b/rake/bluesky.rake @@ -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