github.com/pjdufour-truss/pop@v4.11.2-0.20190705085848-4c90b0ff4d5a+incompatible/soda/cmd/migrate_status.go (about)

     1  package cmd
     2  
     3  import (
     4  	"github.com/gobuffalo/pop"
     5  	"github.com/spf13/cobra"
     6  )
     7  
     8  var migrateStatusCmd = &cobra.Command{
     9  	Use:   "status",
    10  	Short: "Displays the status of all 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.Status()
    17  	},
    18  }
    19  
    20  func init() {
    21  	migrateCmd.AddCommand(migrateStatusCmd)
    22  }