Add insert_feeds config to antenna

This commit is contained in:
KMY 2023-08-19 18:12:30 +09:00
parent 5c758b344c
commit 45a39f1ec3
10 changed files with 100 additions and 45 deletions

View file

@ -0,0 +1,23 @@
# frozen_string_literal: true
require Rails.root.join('lib', 'mastodon', 'migration_helpers')
class AddNoInsertFeedsToAntennas < ActiveRecord::Migration[7.0]
include Mastodon::MigrationHelpers
disable_ddl_transaction!
class Antenna < ApplicationRecord
end
def up
safety_assured do
add_column_with_default :antennas, :insert_feeds, :boolean, default: false, allow_null: false
Antenna.where(insert_feeds: false).update_all(insert_feeds: true) # rubocop:disable Rails/SkipsModelValidations
end
end
def down
remove_column :antennas, :insert_feeds
end
end