Add insert_feeds config to antenna
This commit is contained in:
parent
5c758b344c
commit
45a39f1ec3
10 changed files with 100 additions and 45 deletions
23
db/migrate/20230819084858_add_no_insert_feeds_to_antennas.rb
Normal file
23
db/migrate/20230819084858_add_no_insert_feeds_to_antennas.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue