From 1213d5fa200ff00fd04a9b85b84cab32caa86fc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KMY=EF=BC=88=E9=9B=AA=E3=81=82=E3=81=99=E3=81=8B=EF=BC=89?= Date: Sat, 21 Oct 2023 10:38:14 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20#137=20=E3=83=AD=E3=83=BC=E3=82=AB?= =?UTF-8?q?=E3=83=AB=E3=81=AE=E3=82=AB=E3=82=B9=E3=82=BF=E3=83=A0=E7=B5=B5?= =?UTF-8?q?=E6=96=87=E5=AD=97=E3=81=AB`remote=5Furl`=E3=81=8C=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A=E3=81=95=E3=82=8C=E3=82=8B=E3=83=90=E3=82=B0=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=81=97=E3=81=9F=E3=81=AE=E3=81=AB=E4=BC=B4?= =?UTF-8?q?=E3=81=86=E3=80=81=E6=97=A2=E5=AD=98=E3=81=AE=E3=83=87=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E3=81=8B=E3=82=89=E5=89=8A=E9=99=A4=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=83=9E=E3=82=A4=E3=82=B0=E3=83=AC=E3=83=BC=E3=82=B7=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E3=82=B3=E3=83=BC=E3=83=89=20(#158)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ove_remote_uri_from_local_custom_emojis.rb | 21 +++++++++++++++++++ db/schema.rb | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 db/post_migrate/20231021005339_remove_remote_uri_from_local_custom_emojis.rb diff --git a/db/post_migrate/20231021005339_remove_remote_uri_from_local_custom_emojis.rb b/db/post_migrate/20231021005339_remove_remote_uri_from_local_custom_emojis.rb new file mode 100644 index 0000000000..d541de7429 --- /dev/null +++ b/db/post_migrate/20231021005339_remove_remote_uri_from_local_custom_emojis.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require Rails.root.join('lib', 'mastodon', 'migration_helpers') + +class RemoveRemoteUriFromLocalCustomEmojis < ActiveRecord::Migration[7.0] + include Mastodon::MigrationHelpers + + disable_ddl_transaction! + + class CustomEmoji < ApplicationRecord; end + + def up + safety_assured do + CustomEmoji.transaction do + CustomEmoji.where(domain: nil).update_all(image_remote_url: nil, uri: nil) # rubocop:disable Rails/SkipsModelValidations + end + end + end + + def down; end +end diff --git a/db/schema.rb b/db/schema.rb index 7a4ee11608..af31ed869b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_10_09_235215) do +ActiveRecord::Schema[7.0].define(version: 2023_10_21_005339) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql"