Merge remote-tracking branch 'parent/main' into upstream-20240326

This commit is contained in:
KMY 2024-03-26 09:08:20 +09:00
commit 6c9b221cb2
263 changed files with 4628 additions and 1518 deletions

View file

@ -36,8 +36,8 @@ class MigrateInteractionSettingsToPolicy < ActiveRecord::Migration[7.1]
requires_new_policy = true
end
if deserialized_settings['interactions.must_be_following_dm']
policy.filter_private_mentions = true
unless deserialized_settings['interactions.must_be_following_dm']
policy.filter_private_mentions = false
requires_new_policy = true
end

View file

@ -0,0 +1,15 @@
# frozen_string_literal: true
class CreateRelationshipSeveranceEvents < ActiveRecord::Migration[7.0]
def change
create_table :relationship_severance_events do |t|
t.integer :type, null: false
t.string :target_name, null: false
t.boolean :purged, null: false, default: false
t.timestamps
t.index [:type, :target_name]
end
end
end

View file

@ -0,0 +1,27 @@
# frozen_string_literal: true
class CreateSeveredRelationships < ActiveRecord::Migration[7.0]
def change
create_table :severed_relationships do |t|
# No need to have an index on this foreign key as it is covered by `index_severed_relationships_on_unique_tuples`
t.references :relationship_severance_event, null: false, foreign_key: { on_delete: :cascade }, index: false
# No need to have an index on this foregin key as it is covered by `index_severed_relationships_on_local_account_and_event`
t.references :local_account, null: false, foreign_key: { to_table: :accounts, on_delete: :cascade }, index: false
t.references :remote_account, null: false, foreign_key: { to_table: :accounts, on_delete: :cascade }
# Used to describe whether `local_account` is the active (follower) or passive (followed) part of the relationship
t.integer :direction, null: false
# Those attributes are carried over from the `follows` table
t.boolean :show_reblogs
t.boolean :notify
t.string :languages, array: true
t.timestamps
t.index [:relationship_severance_event_id, :local_account_id, :direction, :remote_account_id], name: 'index_severed_relationships_on_unique_tuples', unique: true
t.index [:local_account_id, :relationship_severance_event_id], name: 'index_severed_relationships_on_local_account_and_event'
end
end
end

View file

@ -0,0 +1,16 @@
# frozen_string_literal: true
class CreateAccountRelationshipSeveranceEvents < ActiveRecord::Migration[7.1]
def change
create_table :account_relationship_severance_events do |t|
t.belongs_to :account, foreign_key: { on_delete: :cascade }, null: false
t.belongs_to :relationship_severance_event, foreign_key: { on_delete: :cascade }, null: false
t.integer :relationships_count, default: 0, null: false
t.index [:account_id, :relationship_severance_event_id], unique: true
t.timestamps
end
end
end

View file

@ -0,0 +1,7 @@
# frozen_string_literal: true
class ChangeNotificationRequestLastStatusIdNullable < ActiveRecord::Migration[7.1]
def change
change_column_null :notification_requests, :last_status_id, true
end
end

View file

@ -0,0 +1,8 @@
# frozen_string_literal: true
class AddFollowersAndFollowingCountsToAccountRelationshipSeveranceEvents < ActiveRecord::Migration[7.1]
def change
add_column :account_relationship_severance_events, :followers_count, :integer, default: 0, null: false
add_column :account_relationship_severance_events, :following_count, :integer, default: 0, null: false
end
end