From a37191350d7625138d0c67193c0b5cf6c866b0ee Mon Sep 17 00:00:00 2001 From: xxq250 Date: Wed, 6 Sep 2023 11:27:46 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E8=A1=A8=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20230413121129_change_webhook_task_field_character.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/db/migrate/20230413121129_change_webhook_task_field_character.rb b/db/migrate/20230413121129_change_webhook_task_field_character.rb index 04c86716d..64e596070 100644 --- a/db/migrate/20230413121129_change_webhook_task_field_character.rb +++ b/db/migrate/20230413121129_change_webhook_task_field_character.rb @@ -1,7 +1,9 @@ class ChangeWebhookTaskFieldCharacter < ActiveRecord::Migration[5.2] def change - Gitea::Base.connection.execute("ALTER TABLE `hook_task` MODIFY `payload_content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;") - Gitea::Base.connection.execute("ALTER TABLE `hook_task` MODIFY `request_content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;") - Gitea::Base.connection.execute("ALTER TABLE `hook_task` MODIFY `response_content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;") + if Gitea::Base.connection.table_exists? :hook_task + Gitea::Base.connection.execute("ALTER TABLE `hook_task` MODIFY `payload_content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;") + Gitea::Base.connection.execute("ALTER TABLE `hook_task` MODIFY `request_content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;") + Gitea::Base.connection.execute("ALTER TABLE `hook_task` MODIFY `response_content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;") + end end end