Skip to content

Commit

Permalink
fix Beego issue 5719
Browse files Browse the repository at this point in the history
  • Loading branch information
flycash committed Nov 28, 2024
1 parent 2dac032 commit 388b9a0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cmd/commands/migrate/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
Expand Down Expand Up @@ -300,6 +300,7 @@ func writeMigrationSourceFile(dir, source, driver, connStr string, latestTime in
// buildMigrationBinary changes directory to database/migrations folder and go-build the source
func buildMigrationBinary(dir, binary string) {
changeDir(dir)
_ = exec.Command("go", "mod", "tidy").Run()
cmd := exec.Command("go", "build", "-o", binary)
if out, err := cmd.CombinedOutput(); err != nil {
beeLogger.Log.Errorf("Could not build migration binary: %s", err)
Expand Down
2 changes: 1 addition & 1 deletion config/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
const confVer = 0

const (
Version = "2.1.0"
Version = "2.3.0"
GitRemotePath = "github.com/beego/bee/v2"
)

Expand Down
2 changes: 1 addition & 1 deletion generate/g_scaffold.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ func GenerateScaffold(sname, fields, currpath, driver, conn string) {
if utils.AskForConfirmation() {
migrate.MigrateUpdate(currpath, driver, conn, "")
}
beeLogger.Log.Successf("All done! Don't forget to add beego.Router(\"/%s\" ,&controllers.%sController{}) to routers/route.go\n", sname, strings.Title(sname))
beeLogger.Log.Successf("All done! Don't forget to add beego.AutoPrefix(\"/%s\" ,&controllers.%sController{}) to routers/route.go\n", sname, strings.Title(sname))
}

0 comments on commit 388b9a0

Please sign in to comment.