mirror of
https://github.com/TECHNOFAB11/dbmate.git
synced 2026-02-02 09:25:07 +01:00
Rename up command to migrate
This commit is contained in:
parent
9cfc758ca1
commit
99a4f266e6
2 changed files with 4 additions and 10 deletions
|
|
@ -104,8 +104,8 @@ func doTransaction(db *sql.DB, txFunc func(shared.Transaction) error) error {
|
||||||
return tx.Commit()
|
return tx.Commit()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpCommand migrates database to the latest version
|
// MigrateCommand migrates database to the latest version
|
||||||
func UpCommand(ctx *cli.Context) error {
|
func MigrateCommand(ctx *cli.Context) error {
|
||||||
migrationsDir := ctx.GlobalString("migrations-dir")
|
migrationsDir := ctx.GlobalString("migrations-dir")
|
||||||
available, err := findAvailableMigrations(migrationsDir)
|
available, err := findAvailableMigrations(migrationsDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
10
main.go
10
main.go
|
|
@ -25,16 +25,10 @@ func main() {
|
||||||
|
|
||||||
app.Commands = []cli.Command{
|
app.Commands = []cli.Command{
|
||||||
{
|
{
|
||||||
Name: "up",
|
Name: "migrate",
|
||||||
Usage: "Migrate to the latest version",
|
Usage: "Migrate to the latest version",
|
||||||
Action: func(ctx *cli.Context) {
|
Action: func(ctx *cli.Context) {
|
||||||
runCommand(UpCommand, ctx)
|
runCommand(MigrateCommand, ctx)
|
||||||
},
|
|
||||||
Flags: []cli.Flag{
|
|
||||||
cli.BoolFlag{
|
|
||||||
Name: "pretend, p",
|
|
||||||
Usage: "don't do anything; print migrations to apply",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue