Merge remote-tracking branch 'parent/main' into upstream-20240926
This commit is contained in:
commit
c905714459
517 changed files with 4284 additions and 3891 deletions
|
@ -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
|
33
db/post_migrate/20240916190140_remove_crypto_scope_values.rb
Normal file
33
db/post_migrate/20240916190140_remove_crypto_scope_values.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue