Skip to content

Commit

Permalink
Fix retrieving migration uuid in export schema
Browse files Browse the repository at this point in the history
  • Loading branch information
priyanshi-yb committed Dec 27, 2024
1 parent 47a8e50 commit 5f5c13c
Showing 1 changed file with 6 additions and 7 deletions.
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

0 comments on commit 5f5c13c

Please sign in to comment.