This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user