refactor:

- 优化 postgresql 的配置文件
- dsn 优化
- gorm logger 代码优化
- 优化 注册表 函数名
- 更新 go.mod
This commit is contained in:
SliverHorn
2021-11-15 23:50:28 +08:00
parent 1744c0b44d
commit f19e719cbb
10 changed files with 128 additions and 244 deletions

View File

@@ -24,7 +24,7 @@ func main() {
global.GVA_DB = initialize.Gorm() // gorm连接数据库
initialize.Timer()
if global.GVA_DB != nil {
initialize.MysqlTables(global.GVA_DB) // 初始化表
initialize.RegisterTables(global.GVA_DB) // 初始化表
// 程序结束前关闭数据库链接
db, _ := global.GVA_DB.DB()
defer db.Close()