diff --git a/db/migrations/20251201104138-add-tx-output-utxo-lookup-index.js b/db/migrations/20251201104138-add-tx-output-utxo-lookup-index.js index 6bfb5a3e..f66c503f 100644 --- a/db/migrations/20251201104138-add-tx-output-utxo-lookup-index.js +++ b/db/migrations/20251201104138-add-tx-output-utxo-lookup-index.js @@ -12,7 +12,7 @@ module.exports = { `); // Only create if it doesn't exist - if (indexes[0].count === 0) { + if (Number(indexes[0].count) === 0) { await queryInterface.sequelize.query(` CREATE INDEX idx_tx_output_utxo_lookup ON tx_output (address, token_id, spent_by, voided, locked, authorities); @@ -30,7 +30,7 @@ module.exports = { AND index_name = 'idx_tx_output_utxo_lookup'; `); - if (indexes[0].count > 0) { + if (Number(indexes[0].count) > 0) { await queryInterface.sequelize.query(` DROP INDEX idx_tx_output_utxo_lookup ON tx_output; `); diff --git a/db/migrations/20260108100000-add-tx-output-locked-heightlock-index.js b/db/migrations/20260108100000-add-tx-output-locked-heightlock-index.js index 08ab85a4..29f0b047 100644 --- a/db/migrations/20260108100000-add-tx-output-locked-heightlock-index.js +++ b/db/migrations/20260108100000-add-tx-output-locked-heightlock-index.js @@ -12,7 +12,7 @@ module.exports = { `); // Only create if it doesn't exist - if (indexes[0].count === 0) { + if (Number(indexes[0].count) === 0) { await queryInterface.sequelize.query(` CREATE INDEX idx_tx_output_locked_heightlock ON tx_output (locked, heightlock); @@ -30,7 +30,7 @@ module.exports = { AND index_name = 'idx_tx_output_locked_heightlock'; `); - if (indexes[0].count > 0) { + if (Number(indexes[0].count) > 0) { await queryInterface.sequelize.query(` DROP INDEX idx_tx_output_locked_heightlock ON tx_output; `); diff --git a/db/migrations/20260108100001-add-tx-output-locked-timelock-index.js b/db/migrations/20260108100001-add-tx-output-locked-timelock-index.js index a5477656..8580da80 100644 --- a/db/migrations/20260108100001-add-tx-output-locked-timelock-index.js +++ b/db/migrations/20260108100001-add-tx-output-locked-timelock-index.js @@ -12,7 +12,7 @@ module.exports = { `); // Only create if it doesn't exist - if (indexes[0].count === 0) { + if (Number(indexes[0].count) === 0) { await queryInterface.sequelize.query(` CREATE INDEX idx_tx_output_locked_timelock ON tx_output (locked, timelock); @@ -30,7 +30,7 @@ module.exports = { AND index_name = 'idx_tx_output_locked_timelock'; `); - if (indexes[0].count > 0) { + if (Number(indexes[0].count) > 0) { await queryInterface.sequelize.query(` DROP INDEX idx_tx_output_locked_timelock ON tx_output; `); diff --git a/db/migrations/20260108100002-add-address-tx-history-addr-voided-token-index.js b/db/migrations/20260108100002-add-address-tx-history-addr-voided-token-index.js index 50e99de9..943a0cf9 100644 --- a/db/migrations/20260108100002-add-address-tx-history-addr-voided-token-index.js +++ b/db/migrations/20260108100002-add-address-tx-history-addr-voided-token-index.js @@ -12,7 +12,7 @@ module.exports = { `); // Only create if it doesn't exist - if (indexes[0].count === 0) { + if (Number(indexes[0].count) === 0) { await queryInterface.sequelize.query(` CREATE INDEX idx_address_tx_history_addr_voided_token ON address_tx_history (address, voided, token_id); @@ -30,7 +30,7 @@ module.exports = { AND index_name = 'idx_address_tx_history_addr_voided_token'; `); - if (indexes[0].count > 0) { + if (Number(indexes[0].count) > 0) { await queryInterface.sequelize.query(` DROP INDEX idx_address_tx_history_addr_voided_token ON address_tx_history; `);