From a945cd8f9ec7f859af8191d0e8e9952070d58ab3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Wed, 16 Oct 2024 13:28:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=A1=A8=E8=84=9A=E6=9C=AC=E7=94=9F=E6=88=90=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/extend/PhinxExtend.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/extend/PhinxExtend.php b/src/extend/PhinxExtend.php index 8efe8758..c90c63b7 100644 --- a/src/extend/PhinxExtend.php +++ b/src/extend/PhinxExtend.php @@ -276,10 +276,12 @@ private static function _build2table(array $tables = [], bool $rehtml = false): */ private function _create_{$table}() { - // 创建更新数据表 - PhinxExtend::upgrade(\$this->table('{$table}', [ + // 创建数据表对象 + \$table = \$this->table('{$table}', [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '{$comment}', - ]), _FIELDS_, _INDEXS_); + ]); + // 创建或更新数据表 + PhinxExtend::upgrade(\$table, _FIELDS_, _INDEXS_); } CODE; // 生成字段内容