mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 02:04:09 +00:00
refactor🎨: 修改sqplite的支持
This commit is contained in:
@@ -11,10 +11,18 @@ import (
|
||||
|
||||
func InitDb(db *gorm.DB) (err error) {
|
||||
filePath := "config/db.sql"
|
||||
err = ExecSql(db, filePath)
|
||||
if global.Driver == "postgres" {
|
||||
filePath = "config/pg.sql"
|
||||
err = ExecSql(db, filePath)
|
||||
} else if global.Driver == "mysql" {
|
||||
filePath = "config/db-begin-mysql.sql"
|
||||
err = ExecSql(db, filePath)
|
||||
filePath = "config/db.sql"
|
||||
err = ExecSql(db, filePath)
|
||||
filePath = "config/db-end-mysql.sql"
|
||||
err = ExecSql(db, filePath)
|
||||
} else {
|
||||
err = ExecSql(db, filePath)
|
||||
}
|
||||
return err
|
||||
}
|
||||
@@ -52,4 +60,4 @@ func Ioutil(filePath string) (string, error) {
|
||||
} else {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user