Skip to content

Commit

Permalink
fix: improve DB migration
Browse files Browse the repository at this point in the history
  • Loading branch information
vasyl-ivanchuk committed Nov 14, 2023
1 parent ee255ed commit e8f22cb
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ export class SetTransferTypeForEmptyBlockTransfers1699955766418 implements Migra
WITH "updatedTransferNumbers" AS
(
UPDATE transfers
SET "type" = 'transfer', "isFeeOrRefund" = false, "isInternal" = true, "updatedAt" = CURRENT_TIMESTAMP
WHERE "transactionHash" IS NULL AND "isInternal" = false
SET "type" = 'transfer', "isFeeOrRefund" = false, "isInternal" = true
WHERE "transactionHash" IS NULL
RETURNING number
)
UPDATE "addressTransfers"
SET "isFeeOrRefund" = false, "isInternal" = true, "updatedAt" = CURRENT_TIMESTAMP
SET "isFeeOrRefund" = false, "isInternal" = true
FROM "updatedTransferNumbers"
WHERE "transferNumber" = "updatedTransferNumbers"."number"
`);
Expand Down

0 comments on commit e8f22cb

Please sign in to comment.