Go-Back-Skeleton/cmd/migrate.go
2024-08-31 19:01:33 +02:00

31 lines
799 B
Go

package cmd
import (
"github.com/spf13/cobra"
"github.com/dhax/go-base/database/migrations"
)
// migrateCmd represents the migrate command
var migrateCmd = &cobra.Command{
Use: "migrate",
Short: "use bun migration tool",
Long: `run bun migrations`,
Run: func(cmd *cobra.Command, args []string) {
migrations.Migrate()
},
}
func init() {
RootCmd.AddCommand(migrateCmd)
// Here you will define your flags and configuration settings.
// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// migrateCmd.PersistentFlags().String("foo", "", "A help for foo")
// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// migrateCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}