mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-05-04 04:57:48 +08:00
修改更新程序
This commit is contained in:
parent
d5349f9769
commit
4cad76a6f3
@ -23,6 +23,7 @@ func Update() {
|
||||
}else if adapter == "sqlite3" {
|
||||
sqliteUpdate()
|
||||
}
|
||||
|
||||
o := orm.NewOrm()
|
||||
|
||||
b,err := ioutil.ReadFile("./data/data.sql")
|
||||
@ -31,6 +32,13 @@ func Update() {
|
||||
panic(err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
sql := string(b)
|
||||
|
||||
_,err = o.Raw(sql).Exec()
|
||||
if err != nil {
|
||||
panic("SITE_NAME => " + err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
fmt.Println("update successed.")
|
||||
|
||||
os.Exit(0)
|
||||
|
Loading…
Reference in New Issue
Block a user