Crowdin / Upload translations / upload-translations (push) Skipped
Historical data migration test / test (14-alpine) (push) Canceled after 0s
Historical data migration test / test (15-alpine) (push) Canceled after 0s
Historical data migration test / test (16-alpine) (push) Canceled after 0s
Historical data migration test / test (17-alpine) (push) Canceled after 0s
Bundler Audit / security (push) Canceled after 0s
Haml Linting / lint (push) Canceled after 0s
JavaScript Linting / lint (push) Canceled after 0s
Ruby Linting / lint (push) Canceled after 0s
JavaScript Testing / test (push) Canceled after 0s
Ruby Testing / build (production) (push) Canceled after 0s
Ruby Testing / test (.ruby-version) (push) Canceled after 0s
Ruby Testing / test (3.3) (push) Canceled after 0s
Ruby Testing / test (3.4) (push) Canceled after 0s
Ruby Testing / End to End testing (.ruby-version) (push) Canceled after 0s
Ruby Testing / End to End testing (3.3) (push) Canceled after 0s
Ruby Testing / End to End testing (3.4) (push) Canceled after 0s
Ruby Testing / Elastic Search integration testing (.ruby-version, docker.elastic.co/elasticsearch/elasticsearch:7.17.29) (push) Canceled after 0s
Check i18n / check-i18n (push) Canceled after 0s
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (javascript) (push) Canceled after 0s
CodeQL / Analyze (ruby) (push) Canceled after 0s
Ruby Testing / Elastic Search integration testing (.ruby-version, opensearchproject/opensearch:2) (push) Canceled after 0s
Ruby Testing / Elastic Search integration testing (3.3, docker.elastic.co/elasticsearch/elasticsearch:7.17.29) (push) Canceled after 0s
Ruby Testing / Elastic Search integration testing (3.4, docker.elastic.co/elasticsearch/elasticsearch:7.17.29) (push) Canceled after 0s
Check formatting / lint (push) Canceled after 0s
CSS Linting / lint (push) Canceled after 0s
Ruby Testing / Elastic Search integration testing (.ruby-version, docker.elastic.co/elasticsearch/elasticsearch:8.19.2) (push) Canceled after 0s
Chromatic / Check for relevant changes (push) Canceled after 0s
Chromatic / Run Chromatic (push) Canceled after 0s
Snapshot of upstream tag v4.7.3 (commit 8ff11c2bb7b9f0714e947b10fa3629c6542c7121) from https://github.com/mastodon/mastodon, unmodified.
33 lines
1.2 KiB
Ruby
33 lines
1.2 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
class RemoveLegacyUserSettingsData < ActiveRecord::Migration[7.2]
|
|
def up
|
|
connection.execute(<<~SQL.squish)
|
|
DELETE FROM settings
|
|
WHERE
|
|
thing_type IS NOT NULL
|
|
AND thing_id IS NOT NULL
|
|
SQL
|
|
|
|
# When running these migrations on mastodon.social, we saw 'notification_emails'
|
|
# and 'interactions' records that were not associated to a user and caused a
|
|
# migration issue.
|
|
# While I have not been able to pinpoint the exact cause of the issue, it is likely
|
|
# related to the settings system changes made in b11fdc3ae3f90731c01149a5a36dc64e065d4ea2.
|
|
# So, delete a few user settings that should already have been deleted.
|
|
connection.execute(<<~SQL.squish)
|
|
DELETE FROM settings
|
|
WHERE var IN (
|
|
'notification_emails', 'interactions', 'boost_modal', 'auto_play_gif',
|
|
'delete_modal', 'system_font_ui', 'default_sensitive', 'unfollow_modal',
|
|
'reduce_motion', 'display_sensitive_media', 'hide_network', 'expand_spoilers',
|
|
'display_media', 'aggregate_reblogs', 'show_application', 'advanced_layout',
|
|
'use_blurhash', 'use_pending_items')
|
|
SQL
|
|
end
|
|
|
|
def down
|
|
raise ActiveRecord::IrreversibleMigration
|
|
end
|
|
end
|