Add: #437 ドメインブロックで「未ログインユーザーに非公開」の設定を「非公開」にコピーするマイグレーションコード
This commit is contained in:
parent
267e9cbcc8
commit
7edb05337e
5 changed files with 23 additions and 6 deletions
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue