destroy

package
v3.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 fmt.Errorf("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

View Source
var YesToAll bool

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL