From 192de79feaee1a1ff93ab62b839588fc41ae7cca Mon Sep 17 00:00:00 2001 From: weifs <605403358@qq.com> Date: Tue, 20 Feb 2024 15:00:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BB=9F=E4=B8=80=E8=A1=A8=E4=B8=BAutf?= =?UTF-8?q?8mb4=5Funicode=5Fci?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...02_18_105804_change_charset_to_utf8mb4.php | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 database/migrations/2024_02_18_105804_change_charset_to_utf8mb4.php diff --git a/database/migrations/2024_02_18_105804_change_charset_to_utf8mb4.php b/database/migrations/2024_02_18_105804_change_charset_to_utf8mb4.php new file mode 100644 index 000000000..6a265fa80 --- /dev/null +++ b/database/migrations/2024_02_18_105804_change_charset_to_utf8mb4.php @@ -0,0 +1,44 @@ +getTablePrefix(); + $tables = [ + "approve_execution", + "approve_execution_history", + "approve_identitylink", + "approve_identitylink_history", + "approve_proc_inst", + "approve_proc_inst_history", + "approve_proc_msgs", + "approve_procdef", + "approve_procdef_history", + "approve_task", + "approve_task_history" + ]; + foreach ($tables as $table) { + if (Schema::hasTable($table)) { + Schema::getConnection()->getPdo()->exec("ALTER TABLE `{$pre}{$table}` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"); + } + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + } +}