12345678910111213141516171819202122232425262728293031 |
- package main
- import (
- "os"
- _ "code.osinet.fr/fgm/kurz/migrations"
- "github.com/pressly/goose"
- "github.com/spf13/cobra"
- )
- var cmdMigrateFix = &cobra.Command{
- Args: cobra.NoArgs,
- Long: "Development command: renumber migrations from timestamps to sequential. Kurz version of 'goose fix'.",
- Run: migrateFixHandler,
- Short: "Fix migrations numbering",
- Use: "fix",
- }
- func init() {
- cmdMigrate.AddCommand(cmdMigrateFix)
- }
- // migrateFixHandler implements the "kurzd migrate fix" command.
- func migrateFixHandler(_ *cobra.Command, args []string) {
- cwd, err := os.Getwd()
- if err != nil {
- panic(err)
- }
- goose.Fix(cwd)
- }
|