diff --git a/db/migrate/20250820230131_remove_e621_user_post_fav_rows.rb b/db/migrate/20250820230131_remove_e621_user_post_fav_rows.rb new file mode 100644 index 00000000..99df4232 --- /dev/null +++ b/db/migrate/20250820230131_remove_e621_user_post_fav_rows.rb @@ -0,0 +1,14 @@ +class RemoveE621UserPostFavRows < ActiveRecord::Migration[7.2] + def up + execute <<-SQL + DELETE FROM domain_user_post_favs + WHERE user_id IN ( + SELECT base_table_id FROM domain_users_e621_aux + ) + SQL + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end diff --git a/db/structure.sql b/db/structure.sql index 7ded30c2..039a5cca 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -1,4 +1,4 @@ -\restrict fsnJecu1BUZk39yUe5E3zqbZEe6yKihIQHKEWYdhLLHCBtdUoLtB3L0VBXECSF8 +\restrict 7TzA6fck7UXmbJ75eMoJZOwzcgQ2b4cZTq1JfFKiTdNPzDaeWqx6fddlLy7O3Jz -- 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) @@ -6129,11 +6129,12 @@ ALTER TABLE ONLY public.domain_twitter_tweets -- PostgreSQL database dump complete -- -\unrestrict fsnJecu1BUZk39yUe5E3zqbZEe6yKihIQHKEWYdhLLHCBtdUoLtB3L0VBXECSF8 +\unrestrict 7TzA6fck7UXmbJ75eMoJZOwzcgQ2b4cZTq1JfFKiTdNPzDaeWqx6fddlLy7O3Jz SET search_path TO "$user", public; INSERT INTO "schema_migrations" (version) VALUES +('20250820230131'), ('20250820215340'), ('20250820212318'), ('20250820210922'),