Skip to content

Commit

Permalink
fix: down migration
Browse files Browse the repository at this point in the history
  • Loading branch information
rompemoldes committed Dec 6, 2024
1 parent d4fd845 commit bceb06f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/migrations/20241204181224-integrateBlockNumbers.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = {
let blockValue = null;
try {
blockValue = BigInt(String(record[columnName]));
} catch (error) {}
} catch {}

// just skip if not a valid number
if (blockValue != null) {
Expand Down Expand Up @@ -80,7 +80,7 @@ module.exports = {

// Transformation from bigInt to string
for (const record of records) {
if (typeof record[columnName] === 'bigint') {
if (record[columnName] != null) {
await queryInterface.sequelize.query(
`UPDATE "${tableName}" SET temporary_col = '${record[columnName]}' WHERE id = '${record.id}'`,
);
Expand Down

0 comments on commit bceb06f

Please sign in to comment.