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

Fix: retrieving migration uuid early in the export schema phase #2128

Merged
merged 2 commits into from
Dec 27, 2024
Merged
Changes from 1 commit
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
13 changes: 6 additions & 7 deletions yb-voyager/cmd/exportSchema.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ var exportSchemaCmd = &cobra.Command{
}

func exportSchema() error {
err := retrieveMigrationUUID()
if err != nil {
log.Errorf("failed to get migration UUID: %v", err)
return fmt.Errorf("failed to get migration UUID: %w", err)
}
if metaDBIsCreated(exportDir) && schemaIsExported() {
if startClean {
proceed := utils.AskPrompt(
Expand Down Expand Up @@ -93,7 +98,7 @@ func exportSchema() error {

utils.PrintAndLog("export of schema for source type as '%s'\n", source.DBType)
// Check connection with source database.
err := source.DB().Connect()
err = source.DB().Connect()
if err != nil {
log.Errorf("failed to connect to the source db: %s", err)
return fmt.Errorf("failed to connect to the source db: %w", err)
Expand Down Expand Up @@ -153,12 +158,6 @@ func exportSchema() error {
}
}

err = retrieveMigrationUUID()
if err != nil {
log.Errorf("failed to get migration UUID: %v", err)
return fmt.Errorf("failed to get migration UUID: %w", err)
}

exportSchemaStartEvent := createExportSchemaStartedEvent()
controlPlane.ExportSchemaStarted(&exportSchemaStartEvent)

Expand Down
Loading