From d6c5f69b0e17635eb96b81ea989efba4c0006008 Mon Sep 17 00:00:00 2001 From: shouder <386734307@qq.com> Date: Mon, 26 Aug 2019 23:52:51 +0800 Subject: [PATCH] =?UTF-8?q?MysqlAdapter=E4=B8=ADgetSqlType=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=BA=86=E6=9C=89=E5=85=B3smallint=E7=9A=84=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E5=88=86=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- phinx/src/Phinx/Db/Adapter/MysqlAdapter.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/phinx/src/Phinx/Db/Adapter/MysqlAdapter.php b/phinx/src/Phinx/Db/Adapter/MysqlAdapter.php index 37710a6..6097177 100644 --- a/phinx/src/Phinx/Db/Adapter/MysqlAdapter.php +++ b/phinx/src/Phinx/Db/Adapter/MysqlAdapter.php @@ -792,8 +792,9 @@ class MysqlAdapter extends PdoAdapter implements AdapterInterface 'tinyint' => static::INT_TINY, ); $limits = array( - 'int' => 11, - 'bigint' => 20, + 'smallint' => 5, + 'int' => 11, + 'bigint' => 20, ); foreach ($sizes as $name => $length) { if ($limit >= $length) { @@ -809,6 +810,9 @@ class MysqlAdapter extends PdoAdapter implements AdapterInterface } return array('name' => 'int', 'limit' => $limit); break; + case static::PHINX_TYPE_SMALL_INTEGER: + return array('name' => 'smallint', 'limit' => 5); + break; case static::PHINX_TYPE_BIG_INTEGER: return array('name' => 'bigint', 'limit' => 20); break;