From 7f8f3a266f20e10e5e8e658407ad014669d0d699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=80=92=E9=9C=89=E7=8B=90=E7=8B=B8?= Date: Fri, 17 Jan 2020 11:57:44 +0800 Subject: [PATCH] =?UTF-8?q?tinyint=E7=AD=89=E7=B1=BB=E5=9E=8Bbool->int8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tinyint等类型应当转换为int8,bool类型会涉及false零值导致差异更新数据时增加复杂度 --- data/view/cnf/def.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/view/cnf/def.go b/data/view/cnf/def.go index eecd369..96c259f 100644 --- a/data/view/cnf/def.go +++ b/data/view/cnf/def.go @@ -16,9 +16,9 @@ var TypeMysqlDicMp = map[string]string{ "char": "string", "date": "time.Time", "datetime": "time.Time", - "bit(1)": "bool", - "tinyint(1)": "bool", - "tinyint(1) unsigned": "bool", + "bit(1)": "int8", + "tinyint(1)": "int8", + "tinyint(1) unsigned": "int8", "json": "string", "text": "string", "timestamp": "time.Time",