feat: Database type support

This commit is contained in:
zhangwenjian committed 2020-07-03 00:34:54 +08:00
1 parent ab34ba8aad
commit a6970e9c67
20 files changed
+190 -301

No files matched your search

+1 -1
View File
@@ -52,7 +52,7 @@ func run() {
}
func migrateModel() error {
if config2.DatabaseConfig.Dbtype == "mysql" {
if config2.DatabaseConfig.DbType == "mysql" {
orm.Eloquent = orm.Eloquent.Set("gorm:table_options", "ENGINE=InnoDB CHARSET=utf8mb4")
}
return gorm.AutoMigrate(orm.Eloquent)