使用qoder优化后更新
Some checks failed
Go build / build and run (push) Has been cancelled

This commit is contained in:
2026-02-12 13:48:35 +08:00
parent abd5962ae9
commit bc59f616fd
15 changed files with 130 additions and 278 deletions

View File

@@ -1,9 +1,3 @@
/*
@Time : 2020/6/28 21:46
@Author : xuyiqing
@File : init.py
*/
package models
import (
@@ -50,12 +44,8 @@ func InitDatabase(conf *config.Config) {
}
DB = db
// 3. 自动迁移数据模型
db.AutoMigrate(&Account{})
db.AutoMigrate(&Content{})
// if err := db.AutoMigrate(&models.Article{}, &models.User{}); err != nil {
// panic("数据库迁移失败: " + err.Error())
// }
// 自动迁移数据模型
db.AutoMigrate(&Account{}, &Content{}, &Option{})
}
type BaseModel struct {