-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
hydra migrate status
subcommand (#3579)
- Loading branch information
Showing
3 changed files
with
87 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright © 2023 Ory Corp | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package cmd | ||
|
||
import ( | ||
"github.com/ory/x/configx" | ||
"github.com/ory/x/servicelocatorx" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/ory/hydra/v2/cmd/cli" | ||
"github.com/ory/hydra/v2/driver" | ||
) | ||
|
||
func NewMigrateStatusCmd(slOpts []servicelocatorx.Option, dOpts []driver.OptionsModifier, cOpts []configx.OptionModifier) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "status", | ||
Short: "Get the current migration status", | ||
RunE: cli.NewHandler(slOpts, dOpts, cOpts).Migration.MigrateStatus, | ||
} | ||
|
||
cmd.Flags().BoolP("read-from-env", "e", false, "If set, reads the database connection string from the environment variable DSN or config file key dsn.") | ||
cmd.Flags().Bool("block", false, "Block until all migrations have been applied") | ||
|
||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters