From 537f49e8162fa56d3a52390da76939fc89053c82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KMY=EF=BC=88=E9=9B=AA=E3=81=82=E3=81=99=E3=81=8B=EF=BC=89?= Date: Wed, 17 Jan 2024 12:15:18 +0900 Subject: [PATCH] =?UTF-8?q?Remove:=20#372=20=E3=83=89=E3=83=A1=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=83=96=E3=83=AD=E3=83=83=E3=82=AF=E3=81=AB=E3=81=8A?= =?UTF-8?q?=E3=81=84=E3=81=A6=E3=80=81DB=E3=81=AE=E4=B8=8D=E8=A6=81?= =?UTF-8?q?=E3=81=AA=E3=82=AB=E3=83=A9=E3=83=A0=E3=82=92=E5=89=8A=E9=99=A4?= =?UTF-8?q?=20(#471)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/domain_block.rb | 44 +++++++++---------- config/locales/en.yml | 2 - config/locales/ja.yml | 3 -- ...2353_remove_legacy_domain_block_columns.rb | 18 ++++++++ db/schema.rb | 6 +-- lib/tasks/dangerous.rake | 9 ++-- 6 files changed, 44 insertions(+), 38 deletions(-) create mode 100644 db/post_migrate/20240117022353_remove_legacy_domain_block_columns.rb diff --git a/app/models/domain_block.rb b/app/models/domain_block.rb index f2f0615434..a0d4f1afea 100644 --- a/app/models/domain_block.rb +++ b/app/models/domain_block.rb @@ -4,30 +4,26 @@ # # Table name: domain_blocks # -# id :bigint(8) not null, primary key -# domain :string default(""), not null -# created_at :datetime not null -# updated_at :datetime not null -# severity :integer default("silence") -# reject_media :boolean default(FALSE), not null -# reject_reports :boolean default(FALSE), not null -# private_comment :text -# public_comment :text -# obfuscate :boolean default(FALSE), not null -# reject_favourite :boolean default(FALSE), not null -# reject_reply :boolean default(FALSE), not null -# reject_send_not_public_searchability :boolean default(FALSE), not null -# reject_send_public_unlisted :boolean default(FALSE), not null -# reject_send_dissubscribable :boolean default(FALSE), not null -# reject_send_media :boolean default(FALSE), not null -# reject_send_sensitive :boolean default(FALSE), not null -# reject_hashtag :boolean default(FALSE), not null -# reject_straight_follow :boolean default(FALSE), not null -# reject_new_follow :boolean default(FALSE), not null -# hidden :boolean default(FALSE), not null -# detect_invalid_subscription :boolean default(FALSE), not null -# reject_reply_exclude_followers :boolean default(FALSE), not null -# reject_friend :boolean default(FALSE), not null +# id :bigint(8) not null, primary key +# domain :string default(""), not null +# created_at :datetime not null +# updated_at :datetime not null +# severity :integer default("silence") +# reject_media :boolean default(FALSE), not null +# reject_reports :boolean default(FALSE), not null +# private_comment :text +# public_comment :text +# obfuscate :boolean default(FALSE), not null +# reject_favourite :boolean default(FALSE), not null +# reject_reply :boolean default(FALSE), not null +# reject_send_sensitive :boolean default(FALSE), not null +# reject_hashtag :boolean default(FALSE), not null +# reject_straight_follow :boolean default(FALSE), not null +# reject_new_follow :boolean default(FALSE), not null +# hidden :boolean default(FALSE), not null +# detect_invalid_subscription :boolean default(FALSE), not null +# reject_reply_exclude_followers :boolean default(FALSE), not null +# reject_friend :boolean default(FALSE), not null # class DomainBlock < ApplicationRecord diff --git a/config/locales/en.yml b/config/locales/en.yml index 970c1fe005..798afeea6e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -456,8 +456,6 @@ en: reject_reports_hint: Ignore all reports coming from this domain. Irrelevant for suspensions reject_send_sensitive: センシティブな投稿を配送しない reject_send_sensitive_hint: 相手サーバーからのフェッチは防げません。停止とは無関係です - reject_send_unlisted_dissubscribable: 購読拒否アカウントの未収載投稿を配送しない - reject_send_unlisted_dissubscribable_hint: 相手サーバーからのフェッチは防げません。停止とは無関係です reject_straight_follow: Reject straight follow reject_straight_follow_hint: The server accounts must be authenticated when follow our accounts undo: Undo domain block diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 0047d4bbf4..234334065b 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -451,8 +451,6 @@ ja: reject_reports_hint: このドメインからの通報をすべて無視します。停止とは無関係です reject_send_sensitive: センシティブな投稿を配送しない reject_send_sensitive_hint: 相手サーバーからのフェッチは防げません。停止とは無関係です - reject_send_unlisted_dissubscribable: 購読拒否アカウントの未収載投稿を配送しない - reject_send_unlisted_dissubscribable_hint: 相手サーバーからのフェッチは防げません。停止とは無関係です reject_straight_follow: フォローを強制的に審査制にする reject_straight_follow_hint: 相手からのフォローは当サーバーのアカウントの承認が必須になります undo: ドメインブロックを戻す @@ -562,7 +560,6 @@ ja: reject_reply_exclude_followers: フォロー相手以外からのリプライを拒否 reject_reports: 通報を拒否 reject_send_sensitive: センシティブ投稿配送なし - reject_send_unlisted_dissubscribable: 購読拒否未収載投稿配送なし reject_straight_follow: フォローを制限 silence: 制限 suspend: サスペンド diff --git a/db/post_migrate/20240117022353_remove_legacy_domain_block_columns.rb b/db/post_migrate/20240117022353_remove_legacy_domain_block_columns.rb new file mode 100644 index 0000000000..958d7491e5 --- /dev/null +++ b/db/post_migrate/20240117022353_remove_legacy_domain_block_columns.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require Rails.root.join('lib', 'mastodon', 'migration_helpers') + +class RemoveLegacyDomainBlockColumns < ActiveRecord::Migration[7.1] + include Mastodon::MigrationHelpers + + disable_ddl_transaction! + + def change + safety_assured do + remove_column :domain_blocks, :reject_send_not_public_searchability, :boolean, null: false, default: false + remove_column :domain_blocks, :reject_send_public_unlisted, :boolean, null: false, default: false + remove_column :domain_blocks, :reject_send_dissubscribable, :boolean, null: false, default: false + remove_column :domain_blocks, :reject_send_media, :boolean, null: false, default: false + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 1024b85113..5bbcc29f37 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2024_01_17_021025) do +ActiveRecord::Schema[7.1].define(version: 2024_01_17_022353) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -566,10 +566,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_01_17_021025) do t.boolean "obfuscate", default: false, null: false t.boolean "reject_favourite", default: false, null: false t.boolean "reject_reply", default: false, null: false - t.boolean "reject_send_not_public_searchability", default: false, null: false - t.boolean "reject_send_public_unlisted", default: false, null: false - t.boolean "reject_send_dissubscribable", default: false, null: false - t.boolean "reject_send_media", default: false, null: false t.boolean "reject_send_sensitive", default: false, null: false t.boolean "reject_hashtag", default: false, null: false t.boolean "reject_straight_follow", default: false, null: false diff --git a/lib/tasks/dangerous.rake b/lib/tasks/dangerous.rake index 8086e56e5b..2a300efd81 100644 --- a/lib/tasks/dangerous.rake +++ b/lib/tasks/dangerous.rake @@ -78,6 +78,7 @@ namespace :dangerous do 20230223102416 20230222232121 20240117021025 + 20240117022353 ) # Removed: account_groups target_tables = %w( @@ -128,10 +129,10 @@ namespace :dangerous do %w(domain_blocks reject_new_follow), %w(domain_blocks reject_reply), %w(domain_blocks reject_reply_exclude_followers), - %w(domain_blocks reject_send_dissubscribable), - %w(domain_blocks reject_send_media), - %w(domain_blocks reject_send_not_public_searchability), - %w(domain_blocks reject_send_public_unlisted), + # Removed: domain_blocks reject_send_dissubscribable + # Removed: domain_blocks reject_send_media + # Removed: domain_blocks reject_send_not_public_searchability + # Removed: domain_blocks reject_send_public_unlisted # Removed: domain_blocks reject_send_unlisted_dissubscribable %w(domain_blocks reject_send_sensitive), %w(domain_blocks reject_straight_follow),