Skip to content

Commit

Permalink
update migration_block query and return completed status if it migrat…
Browse files Browse the repository at this point in the history
…ion is done
  • Loading branch information
vkuznet committed Aug 29, 2022
1 parent b18fa6d commit e4c14db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions dbs/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,12 @@ func (a *API) ProcessMigration() {
log.Printf("query='%s' args='%v' error=%v", stm, args, err)
return
}
// if status of migration block is completed then we update status of migration request
if bid != 0 && bStatus == int64(COMPLETED) {
status = COMPLETED
updateMigrationStatus(mrec, COMPLETED)
return
}

// check if our migration input is block name or dataset
if !strings.Contains(migInput, "#") {
Expand Down
1 change: 0 additions & 1 deletion static/sql/migration_block.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ SELECT
MIGRATION_STATUS
FROM {{.Owner}}.MIGRATION_BLOCKS
WHERE MIGRATION_REQUEST_ID=:migration_request_id
AND (MIGRATION_STATUS=0 or MIGRATION_STATUS=1 or MIGRATION_STATUS=3) ORDER BY MIGRATION_ORDER DESC

0 comments on commit e4c14db

Please sign in to comment.