drop legacy domain tables

This commit is contained in:
Dylan Knutson
2025-07-22 04:54:12 +00:00
parent fe51855ebd
commit 8d65c2514a
6 changed files with 192 additions and 1527 deletions

View File

@@ -0,0 +1,14 @@
class MoveBlobFilesTablespaces < ActiveRecord::Migration[7.2]
disable_ddl_transaction!
def up
64.times { |i| execute <<-SQL }
ALTER TABLE blob_files_#{i.to_s.rjust(2, "0")} SET TABLESPACE pg_default;
ALTER INDEX index_blob_files_#{i.to_s.rjust(2, "0")}_on_sha256 SET TABLESPACE pg_default;
SQL
end
def down
raise ActiveRecord::IrreversibleMigration
end
end

View File

@@ -0,0 +1,13 @@
class DropOldE621DomainTables < ActiveRecord::Migration[7.2]
def up
drop_table :domain_e621_favs
drop_table :domain_e621_taggings
drop_table :domain_e621_tags
drop_table :domain_e621_posts
drop_table :domain_e621_users
end
def down
raise ActiveRecord::IrreversibleMigration
end
end

View File

@@ -0,0 +1,15 @@
class DropOldFaDomainTables < ActiveRecord::Migration[7.2]
def up
drop_table :domain_fa_user_avatar_versions
drop_table :domain_fa_user_avatars
drop_table :domain_fa_favs
drop_table :domain_fa_user_factors
drop_table :domain_fa_follows
drop_table :domain_fa_post_factors
drop_table :domain_fa_users
end
def down
raise ActiveRecord::IrreversibleMigration
end
end

View File

@@ -0,0 +1,17 @@
class DropOldIbDomainTables < ActiveRecord::Migration[7.2]
def up
drop_table :domain_inkbunny_favs
drop_table :domain_inkbunny_taggings
drop_table :domain_inkbunny_pool_joins
drop_table :domain_inkbunny_follows
drop_table :domain_inkbunny_pools
drop_table :domain_inkbunny_tags
drop_table :domain_inkbunny_files
drop_table :domain_inkbunny_posts
drop_table :domain_inkbunny_users
end
def down
raise ActiveRecord::IrreversibleMigration
end
end

File diff suppressed because it is too large Load Diff

View File

@@ -13,9 +13,6 @@ format-changed:
format-all: format-all:
find . -name '*.rb' -type f -exec sh -c 'stree format "$1" > "$1.tmp" && mv "$1.tmp" "$1"' sh {} \; find . -name '*.rb' -type f -exec sh -c 'stree format "$1" > "$1.tmp" && mv "$1.tmp" "$1"' sh {} \;
psql-dump-domain-fa-favs:
@psql -P pager=off -c 'select user_id, post_id, 1 from domain_fa_favs limit 10000000;' -d redux_prod -h 10.166.33.171 -U scraper_redux -t -A -F ' '
test: test:
bundle exec srb tc bundle exec srb tc
rm -rf tmp/blob_files_test/thumbnails rm -rf tmp/blob_files_test/thumbnails