mirror of
https://github.com/beego/bee.git
synced 2024-11-22 10:10:53 +00:00
Fixing absolute path for dir option of migration
This commit is contained in:
parent
3d977edbb4
commit
10a2e56df0
@ -98,11 +98,22 @@ func RunMigration(cmd *commands.Command, args []string) int {
|
|||||||
}
|
}
|
||||||
if mDir == "" {
|
if mDir == "" {
|
||||||
mDir = utils.DocValue(config.Conf.Database.Dir)
|
mDir = utils.DocValue(config.Conf.Database.Dir)
|
||||||
|
if mDir == "" {
|
||||||
|
mDir = utils.DocValue(path.Join(currpath, "database", "migrations"))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
beeLogger.Log.Infof("Using '%s' as 'driver'", mDriver)
|
beeLogger.Log.Infof("Using '%s' as 'driver'", mDriver)
|
||||||
beeLogger.Log.Infof("Using '%s' as 'conn'", mConn)
|
beeLogger.Log.Infof("Using '%s' as 'conn'", mConn)
|
||||||
beeLogger.Log.Infof("Using '%s' as 'dir'", mDir)
|
beeLogger.Log.Infof("Using '%s' as 'dir'", mDir)
|
||||||
driverStr, connStr, dirStr := string(mDriver), string(mConn), string(mDir)
|
driverStr, connStr, dirStr := string(mDriver), string(mConn), string(mDir)
|
||||||
|
|
||||||
|
dirRune := []rune(dirStr)
|
||||||
|
|
||||||
|
if dirRune[0] != '/' && dirRune[1] != ':' {
|
||||||
|
dirStr = path.Join(currpath, dirStr)
|
||||||
|
}
|
||||||
|
|
||||||
if len(args) == 0 {
|
if len(args) == 0 {
|
||||||
// run all outstanding migrations
|
// run all outstanding migrations
|
||||||
beeLogger.Log.Info("Running all outstanding migrations")
|
beeLogger.Log.Info("Running all outstanding migrations")
|
||||||
|
Loading…
Reference in New Issue
Block a user