From 6e40f4cb17e46fcbd29443b03364672db7cd07e3 Mon Sep 17 00:00:00 2001 From: taoshihan1991 <630892807@qq.com> Date: Tue, 9 Feb 2021 17:55:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=AD=98=E8=A1=A8=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/go-fly.sql | 2 +- models/models.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/go-fly.sql b/config/go-fly.sql index 306234e..9a9a082 100644 --- a/config/go-fly.sql +++ b/config/go-fly.sql @@ -50,7 +50,7 @@ CREATE TABLE `message` ( PRIMARY KEY (`id`), KEY `kefu_id` (`kefu_id`), KEY `visitor_id` (`visitor_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8| +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4| DROP TABLE IF EXISTS `user_role`| CREATE TABLE `user_role` ( diff --git a/models/models.go b/models/models.go index 4c9972e..eb92f23 100644 --- a/models/models.go +++ b/models/models.go @@ -19,7 +19,7 @@ type Model struct { func init() { mysql := config.CreateMysql() - dsn := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8&parseTime=True&loc=Local", mysql.Username, mysql.Password, mysql.Server, mysql.Port, mysql.Database) + dsn := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True&loc=Local", mysql.Username, mysql.Password, mysql.Server, mysql.Port, mysql.Database) var err error DB, err = gorm.Open("mysql", dsn) if err != nil {