mirror of
https://github.com/ZSCNetSupportDept/scheduler.git
synced 2025-10-28 20:45:05 +08:00
数据库AutoMigrate现在是可选的,添加了启动参数
This commit is contained in:
@@ -33,9 +33,10 @@ func connectSQLite() {
|
||||
fmt.Printf("error in connecting to SQLite:")
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
|
||||
}
|
||||
Main.AutoMigrate(&model.Member{}, &model.Tweak{})
|
||||
if config.InitDB == true {
|
||||
Main.AutoMigrate(&model.Member{}, &model.Tweak{})
|
||||
}
|
||||
}
|
||||
|
||||
func connectPGSQL() {
|
||||
@@ -43,5 +44,7 @@ func connectPGSQL() {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
Main.AutoMigrate(&model.Member{}, &model.Tweak{})
|
||||
if config.InitDB == true {
|
||||
Main.AutoMigrate(&model.Member{}, &model.Tweak{})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user