Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "cmd/atlas/internal: allow extension of migrate command (#1904)" #1905

Merged
merged 1 commit into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions cmd/atlas/internal/cmdapi/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,22 @@ import (
"github.com/spf13/cobra"
)

func init() {
migrateCmd := migrateCmd()
migrateCmd.AddCommand(
migrateApplyCmd(),
migrateDiffCmd(),
migrateHashCmd(),
migrateImportCmd(),
migrateLintCmd(),
migrateNewCmd(),
migrateSetCmd(),
migrateStatusCmd(),
migrateValidateCmd(),
)
Root.AddCommand(migrateCmd)
}

// migrateCmd represents the subcommand 'atlas migrate'.
func migrateCmd() *cobra.Command {
cmd := &cobra.Command{
Expand Down Expand Up @@ -507,11 +523,6 @@ type migrateDiffFlags struct {

// migrateDiffCmd represents the 'atlas migrate diff' subcommand.
func migrateDiffCmd() *cobra.Command {
cmd, _ := migrateDiffWithFlagsCmd()
return cmd
}

func migrateDiffWithFlagsCmd() (*cobra.Command, *migrateDiffFlags) {
var (
flags migrateDiffFlags
cmd = &cobra.Command{
Expand Down Expand Up @@ -556,7 +567,7 @@ directory state to the desired schema. The desired state can be another connecte
cmd.Flags().BoolVarP(&flags.edit, flagEdit, "", false, "edit the generated migration file(s)")
cobra.CheckErr(cmd.MarkFlagRequired(flagTo))
cobra.CheckErr(cmd.MarkFlagRequired(flagDevURL))
return cmd, &flags
return cmd
}

func migrateDiffRun(cmd *cobra.Command, args []string, flags migrateDiffFlags, env *Env) error {
Expand Down
23 changes: 0 additions & 23 deletions cmd/atlas/internal/cmdapi/migrate_oss.go

This file was deleted.

Loading