fix: failed create record if use mysql (close #1690)

This commit is contained in:
Noah Hsu
2022-09-16 22:21:43 +08:00
parent 1af9f4061e
commit d329df70f3
2 changed files with 7 additions and 4 deletions

View File

@ -53,9 +53,6 @@ func InitDB() {
dsn := fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?charset=utf8mb4&parseTime=True&loc=Local&tls=%s",
database.User, database.Password, database.Host, database.Port, database.Name, database.SSLMode)
dB, err = gorm.Open(mysql.Open(dsn), gormConfig)
if err == nil {
dB = dB.Set("gorm:table_options", "ENGINE=InnoDB CHARSET=utf8mb4")
}
}
case "postgres":
{