buffalo-pop: github.com/gobuffalo/buffalo-pop/cmd/destroy Index | Files

package destroy

import "github.com/gobuffalo/buffalo-pop/cmd/destroy"

Index

Package Files

destroy.go model.go

Variables

var ModelCmd = &cobra.Command{
    Use: "model [name]",

    Aliases: []string{"m"},
    Short:   "Destroys model files.",
    RunE: func(cmd *cobra.Command, args []string) error {
        if len(args) == 0 {
            return errors.New("you need to provide a valid model name in order to destroy it")
        }

        name := args[0]
        fileName := flect.Pluralize(flect.Underscore(name))

        removeModel(name)
        removeMigrations(fileName)

        return nil
    },
}

ModelCmd destroys a passed model

var YesToAll bool

Package destroy imports 9 packages (graph) and is imported by 1 packages. Updated 2019-02-01. Refresh now. Tools for package owners.