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

This commit is contained in:
KMY 2024-09-26 08:29:41 +09:00
commit c905714459
517 changed files with 4284 additions and 3891 deletions

View file

@ -0,0 +1,15 @@
# frozen_string_literal: true
class DropEndToEndMessageTables < ActiveRecord::Migration[7.1]
def up
drop_table :system_keys
drop_table :one_time_keys
drop_table :encrypted_messages
drop_table :devices
safety_assured { remove_column :accounts, :devices_url }
end
def down
raise ActiveRecord::IrreversibleMigration
end
end

View file

@ -0,0 +1,33 @@
# frozen_string_literal: true
class RemoveCryptoScopeValues < ActiveRecord::Migration[7.1]
def up
applications.in_batches do |records|
records.update_all(<<~SQL.squish)
scopes = TRIM(REPLACE(scopes, 'crypto', ''))
SQL
end
tokens.in_batches do |records|
records.update_all(<<~SQL.squish)
scopes = TRIM(REPLACE(scopes, 'crypto', ''))
SQL
end
end
def down
raise ActiveRecord::IrreversibleMigration
end
private
def applications
Doorkeeper::Application
.where("scopes LIKE '%crypto%'")
end
def tokens
Doorkeeper::AccessToken
.where("scopes LIKE '%crypto%'")
end
end