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
|
|
@ -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_08_14_223300) do
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_08_19_084858) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
|
@ -308,6 +308,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_14_223300) do
|
|||
t.jsonb "exclude_tags"
|
||||
t.boolean "stl", default: false, null: false
|
||||
t.boolean "ignore_reblog", default: false, null: false
|
||||
t.boolean "insert_feeds", default: false, null: false
|
||||
t.index ["account_id"], name: "index_antennas_on_account_id"
|
||||
t.index ["any_accounts"], name: "index_antennas_on_any_accounts"
|
||||
t.index ["any_domains"], name: "index_antennas_on_any_domains"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue