Merge tag 'v3.1.5' into instance_only_statuses
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
class AddInviteIdToUsers < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
add_reference :users, :invite, null: true, default: nil, foreign_key: { on_delete: :nullify }, index: false
|
||||
safety_assured { add_reference :users, :invite, null: true, default: nil, foreign_key: { on_delete: :nullify }, index: false }
|
||||
end
|
||||
end
|
||||
|
@ -1,5 +1,5 @@
|
||||
class AddAssignedAccountIdToReports < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
add_reference :reports, :assigned_account, null: true, default: nil, foreign_key: { on_delete: :nullify, to_table: :accounts }, index: false
|
||||
safety_assured { add_reference :reports, :assigned_account, null: true, default: nil, foreign_key: { on_delete: :nullify, to_table: :accounts }, index: false }
|
||||
end
|
||||
end
|
||||
|
@ -1,6 +1,8 @@
|
||||
class AddAccessTokenIdToWebPushSubscriptions < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_reference :web_push_subscriptions, :access_token, null: true, default: nil, foreign_key: { on_delete: :cascade, to_table: :oauth_access_tokens }, index: false
|
||||
add_reference :web_push_subscriptions, :user, null: true, default: nil, foreign_key: { on_delete: :cascade }, index: false
|
||||
safety_assured do
|
||||
add_reference :web_push_subscriptions, :access_token, null: true, default: nil, foreign_key: { on_delete: :cascade, to_table: :oauth_access_tokens }, index: false
|
||||
add_reference :web_push_subscriptions, :user, null: true, default: nil, foreign_key: { on_delete: :cascade }, index: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -2,7 +2,7 @@ class AddCreatedByApplicationIdToUsers < ActiveRecord::Migration[5.2]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
add_reference :users, :created_by_application, foreign_key: { to_table: 'oauth_applications', on_delete: :nullify }, index: false
|
||||
safety_assured { add_reference :users, :created_by_application, foreign_key: { to_table: 'oauth_applications', on_delete: :nullify }, index: false }
|
||||
add_index :users, :created_by_application_id, algorithm: :concurrently
|
||||
end
|
||||
end
|
||||
|
@ -2,7 +2,7 @@ class AddScheduledStatusIdToMediaAttachments < ActiveRecord::Migration[5.2]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
add_reference :media_attachments, :scheduled_status, foreign_key: { on_delete: :nullify }, index: false
|
||||
safety_assured { add_reference :media_attachments, :scheduled_status, foreign_key: { on_delete: :nullify }, index: false }
|
||||
add_index :media_attachments, :scheduled_status_id, algorithm: :concurrently
|
||||
end
|
||||
end
|
||||
|
@ -0,0 +1,5 @@
|
||||
class AddHideCollectionsToAccounts < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :accounts, :hide_collections, :boolean
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddProcessingToMediaAttachments < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :media_attachments, :processing, :integer
|
||||
end
|
||||
end
|
@ -0,0 +1,15 @@
|
||||
require Rails.root.join('lib', 'mastodon', 'migration_helpers')
|
||||
|
||||
class AddTitleToAccountWarningPresets < ActiveRecord::Migration[5.2]
|
||||
include Mastodon::MigrationHelpers
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
safety_assured { add_column_with_default :account_warning_presets, :title, :string, default: '', allow_null: false }
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :account_warning_presets, :title
|
||||
end
|
||||
end
|
@ -0,0 +1,6 @@
|
||||
class AddStatusIdsToAnnouncements < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :announcements, :status_ids, :bigint, array: true
|
||||
end
|
||||
end
|
||||
|
@ -0,0 +1,5 @@
|
||||
class AddParentIdToEmailDomainBlocks < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
safety_assured { add_reference :email_domain_blocks, :parent, null: true, default: nil, foreign_key: { on_delete: :cascade, to_table: :email_domain_blocks }, index: false }
|
||||
end
|
||||
end
|
9
db/migrate/20200407201300_create_unavailable_domains.rb
Normal file
9
db/migrate/20200407201300_create_unavailable_domains.rb
Normal file
@ -0,0 +1,9 @@
|
||||
class CreateUnavailableDomains < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :unavailable_domains do |t|
|
||||
t.string :domain, default: '', null: false, index: { unique: true }
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
21
db/migrate/20200407202420_migrate_unavailable_inboxes.rb
Normal file
21
db/migrate/20200407202420_migrate_unavailable_inboxes.rb
Normal file
@ -0,0 +1,21 @@
|
||||
class MigrateUnavailableInboxes < ActiveRecord::Migration[5.2]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
urls = Redis.current.smembers('unavailable_inboxes')
|
||||
|
||||
hosts = urls.map do |url|
|
||||
Addressable::URI.parse(url).normalized_host
|
||||
end.compact.uniq
|
||||
|
||||
UnavailableDomain.delete_all
|
||||
|
||||
hosts.each do |host|
|
||||
UnavailableDomain.create(domain: host)
|
||||
end
|
||||
|
||||
Redis.current.del(*(['unavailable_inboxes'] + Redis.current.keys('exhausted_deliveries:*')))
|
||||
end
|
||||
|
||||
def down; end
|
||||
end
|
9
db/migrate/20200417125749_add_storage_schema_version.rb
Normal file
9
db/migrate/20200417125749_add_storage_schema_version.rb
Normal file
@ -0,0 +1,9 @@
|
||||
class AddStorageSchemaVersion < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :preview_cards, :image_storage_schema_version, :integer
|
||||
add_column :accounts, :avatar_storage_schema_version, :integer
|
||||
add_column :accounts, :header_storage_schema_version, :integer
|
||||
add_column :media_attachments, :file_storage_schema_version, :integer
|
||||
add_column :custom_emojis, :image_storage_schema_version, :integer
|
||||
end
|
||||
end
|
12
db/migrate/20200508212852_reset_unique_jobs_locks.rb
Normal file
12
db/migrate/20200508212852_reset_unique_jobs_locks.rb
Normal file
@ -0,0 +1,12 @@
|
||||
class ResetUniqueJobsLocks < ActiveRecord::Migration[5.2]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
# We do this to clean up unique job digests that were not properly
|
||||
# disposed of prior to https://github.com/tootsuite/mastodon/pull/13361
|
||||
|
||||
SidekiqUniqueJobs::Digests.delete_by_pattern('*', count: SidekiqUniqueJobs::Digests.count)
|
||||
end
|
||||
|
||||
def down; end
|
||||
end
|
15
db/migrate/20200510110808_reset_web_app_secret.rb
Normal file
15
db/migrate/20200510110808_reset_web_app_secret.rb
Normal file
@ -0,0 +1,15 @@
|
||||
class ResetWebAppSecret < ActiveRecord::Migration[5.2]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
web_app = Doorkeeper::Application.find_by(superapp: true)
|
||||
|
||||
return if web_app.nil?
|
||||
|
||||
web_app.renew_secret
|
||||
web_app.save!
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user