Add: #437 ドメインブロックで「未ログインユーザーに非公開」の設定を「非公開」にコピーするマイグレーションコード

This commit is contained in:
KMY 2024-01-09 13:08:48 +09:00
parent 267e9cbcc8
commit 7edb05337e
5 changed files with 23 additions and 6 deletions

View file

@ -0,0 +1,18 @@
# frozen_string_literal: true
class RemoveHiddenAnonymousFromDomainBlocks < ActiveRecord::Migration[7.1]
class DomainBlock < ApplicationRecord; end
def up
safety_assured do
DomainBlock.where(hidden_anonymous: true, hidden: false).update_all(hidden: true)
remove_column :domain_blocks, :hidden_anonymous
end
end
def down
safety_assured do
add_column :domain_blocks, :hidden_anonymous, :boolean, null: false, default: false
end
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2023_12_12_225737) do
ActiveRecord::Schema[7.1].define(version: 2024_01_09_035435) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -570,7 +570,6 @@ ActiveRecord::Schema[7.0].define(version: 2023_12_12_225737) do
t.boolean "reject_straight_follow", default: false, null: false
t.boolean "reject_new_follow", default: false, null: false
t.boolean "hidden", default: false, null: false
t.boolean "hidden_anonymous", default: false, null: false
t.boolean "detect_invalid_subscription", default: false, null: false
t.boolean "reject_reply_exclude_followers", default: false, null: false
t.index ["domain"], name: "index_domain_blocks_on_domain", unique: true