github.com/mpontillo/pop@v4.13.1+incompatible/soda/cmd/migrate_up.go (about)

     1  package cmd
     2  
     3  import (
     4  	"github.com/gobuffalo/pop"
     5  	"github.com/spf13/cobra"
     6  )
     7  
     8  var migrateUpCmd = &cobra.Command{
     9  	Use:   "up",
    10  	Short: "Apply all of the 'up' migrations.",
    11  	RunE: func(cmd *cobra.Command, args []string) error {
    12  		mig, err := pop.NewFileMigrator(migrationPath, getConn())
    13  		if err != nil {
    14  			return err
    15  		}
    16  		return mig.Up()
    17  	},
    18  }
    19  
    20  func init() {
    21  	migrateCmd.AddCommand(migrateUpCmd)
    22  }