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

     1  package cmd
     2  
     3  import (
     4  	"github.com/gobuffalo/pop"
     5  	"github.com/gobuffalo/pop/internal/oncer"
     6  	"github.com/spf13/cobra"
     7  )
     8  
     9  // Deprecated: use resetCmd instead.
    10  var migrateResetCmd = &cobra.Command{
    11  	Use:   "reset",
    12  	Short: "The equivalent of running `migrate down` and then `migrate up`",
    13  	RunE: func(cmd *cobra.Command, args []string) error {
    14  		oncer.Deprecate(0, "command `migrate reset`", "Use command `reset` instead.")
    15  		mig, err := pop.NewFileMigrator(migrationPath, getConn())
    16  		if err != nil {
    17  			return err
    18  		}
    19  		return mig.Reset()
    20  	},
    21  }
    22  
    23  func init() {
    24  	migrateCmd.AddCommand(migrateResetCmd)
    25  }