Skip to content

Commit

Permalink
Added code to prompt user when target-db-version flag not mentioned (#…
Browse files Browse the repository at this point in the history
…2249)

* Added code to prompt user when target-db-schema flag not mentioned

* Modified the analyze-schema test adding the --yes flag.

* Made suggested changes and removes previous changes.

---------

Co-authored-by: Atharva Kurhade <[email protected]>
  • Loading branch information
atharva-kurhade-yb and Atharva Kurhade authored Jan 28, 2025
1 parent aebbe93 commit 396bece
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions migtests/scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ export_data() {
analyze_schema() {
args="--export-dir ${EXPORT_DIR}
--send-diagnostics=false
--yes
"
yb-voyager analyze-schema ${args} $*
}
Expand Down
10 changes: 8 additions & 2 deletions yb-voyager/cmd/assessMigrationCommand.go
Original file line number Diff line number Diff line change
Expand Up @@ -1700,9 +1700,15 @@ func validateAssessmentMetadataDirFlag() {

func validateAndSetTargetDbVersionFlag() error {
if targetDbVersionStrFlag == "" {
targetDbVersion = ybversion.LatestStable
return nil
if utils.AskPrompt("No target-db-version has been specified.\nDo you want to continue with the latest stable YugabyteDB version:", ybversion.LatestStable.String()) {
targetDbVersion = ybversion.LatestStable
return nil
} else {
utils.ErrExit("Aborting..")
return nil
}
}

var err error
targetDbVersion, err = ybversion.NewYBVersion(targetDbVersionStrFlag)

Expand Down

0 comments on commit 396bece

Please sign in to comment.