diff --git a/db/seeders/20250416132150-add-htr-token.js b/db/seeders/20250416132150-add-htr-token.js index 97480149..402ee5db 100644 --- a/db/seeders/20250416132150-add-htr-token.js +++ b/db/seeders/20250416132150-add-htr-token.js @@ -2,6 +2,16 @@ module.exports = { up: async (queryInterface) => { + // Check if HTR token already exists + const [existing] = await queryInterface.sequelize.query( + "SELECT id FROM token WHERE id = '00'" + ); + + if (existing.length > 0) { + console.log('HTR token already exists, skipping.'); + return; + } + // Count unique transactions for HTR const [results] = await queryInterface.sequelize.query( "SELECT COUNT(DISTINCT tx_id) AS count FROM tx_output WHERE token_id = '00'" @@ -14,6 +24,7 @@ module.exports = { name: 'Hathor', symbol: 'HTR', transactions: htrTxCount, + version: 0, // TokenVersion.NATIVE }]); },