From 7109da511c80342afcf682da45d914ad89d7e9f3 Mon Sep 17 00:00:00 2001 From: zhenghongyang Date: Sun, 13 Sep 2020 14:39:57 +0800 Subject: [PATCH 1/2] supprot muti mig db pool --- app/Migration/User.php | 2 +- bin/swoft | 0 2 files changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 bin/swoft diff --git a/app/Migration/User.php b/app/Migration/User.php index 2292766d..9f04f459 100644 --- a/app/Migration/User.php +++ b/app/Migration/User.php @@ -18,7 +18,7 @@ * * @since 2.0 * - * @Migration(20190630164222) + * @Migration(time=20190630164222, pool="db.pool,db1.pool") */ class User extends BaseMigration { diff --git a/bin/swoft b/bin/swoft old mode 100644 new mode 100755 From c39436108a07b8b4c7f8a399d0e01f5248832dd6 Mon Sep 17 00:00:00 2001 From: zhenghongyang Date: Sun, 13 Sep 2020 15:02:37 +0800 Subject: [PATCH 2/2] perfect db demo --- app/bean.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/bean.php b/app/bean.php index a0e8d54b..ce36b774 100644 --- a/app/bean.php +++ b/app/bean.php @@ -84,6 +84,7 @@ 'dsn' => 'mysql:dbname=test2;host=127.0.0.1', 'username' => 'root', 'password' => 'swoft123456', + 'charset' => 'utf8mb4', // 'dbSelector' => bean(DbSelector::class) ], 'db2.pool' => [ @@ -94,7 +95,8 @@ 'class' => Database::class, 'dsn' => 'mysql:dbname=test2;host=127.0.0.1', 'username' => 'root', - 'password' => 'swoft123456' + 'password' => 'swoft123456', + 'charset' => 'utf8mb4', ], 'db3.pool' => [ 'class' => Pool::class,