Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cobra.Command{ Use: "up", Short: "更新数据库", Long: `更新数据库`, RunE: func(cmd *cobra.Command, args []string) error { var cmdParse clap.YamlConfig if clap.GenPath != "" { configFileParams, err := clap.LoadConfigFile(clap.GenPath) if err != nil { return err } cmdParse = *configFileParams } else { if sourceURL != "" { cmdParse.SourceURL = sourceURL } if databaseURL != "" { cmdParse.DatabaseURL = databaseURL } } m, err := migrate.New(cmdParse.SourceURL, cmdParse.DatabaseURL) if err != nil { return err } defer func() { if _, err := m.Close(); err != nil { log.Error(err) } }() if err = m.Up(); err != nil { if errors.Is(err, migrate.ErrNoChange) { return nil } return err } return nil }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.