drop legacy domain tables
This commit is contained in:
14
db/migrate/20250722005802_move_blob_files_tablespaces.rb
Normal file
14
db/migrate/20250722005802_move_blob_files_tablespaces.rb
Normal 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
|
||||||
13
db/migrate/20250722010327_drop_old_e621_domain_tables.rb
Normal file
13
db/migrate/20250722010327_drop_old_e621_domain_tables.rb
Normal 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
|
||||||
15
db/migrate/20250722010822_drop_old_fa_domain_tables.rb
Normal file
15
db/migrate/20250722010822_drop_old_fa_domain_tables.rb
Normal 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
|
||||||
17
db/migrate/20250722013801_drop_old_ib_domain_tables.rb
Normal file
17
db/migrate/20250722013801_drop_old_ib_domain_tables.rb
Normal 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
|
||||||
1657
db/structure.sql
1657
db/structure.sql
File diff suppressed because it is too large
Load Diff
3
justfile
3
justfile
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user