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

Added warning to import.go for target-db-schema flag #2241

Merged
Merged
Changes from 2 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
2 changes: 1 addition & 1 deletion yb-voyager/cmd/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func validateTargetPortRange() {

func validateTargetSchemaFlag() {
// do not check for source and source-replica imports
if importerRole == TARGET_DB_IMPORTER_ROLE {
if !(importerRole == SOURCE_REPLICA_DB_IMPORTER_ROLE || importerRole == SOURCE_DB_IMPORTER_ROLE || importerRole == IMPORT_FILE_ROLE) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: use !slices.Contains([]string{SOURCE_REPLICA_DB_IMPORTER_ROLE, SOURCE_DB_IMPORTER_ROLE, IMPORT_FILE_ROLE}, importerRole)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Why have we removed the check on TARGET_DB_IMPORTER_ROLE here?
  2. Can we please add a comment here, from the discussion/decision you guys made.
    cc @makalaaneesh @priyanshi-yb

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added the comment specifying why the check was changed.

if tconf.Schema != "" && sourceDBType == "postgresql" {
utils.ErrExit("Error: --target-db-schema flag is not valid for export from 'postgresql' db type")
}
sanyamsinghal marked this conversation as resolved.
Show resolved Hide resolved
Expand Down