Skip to content

Commit 2e942e0

Browse files
authored
fix: HTR token seed migration (#367)
1 parent 59c7def commit 2e942e0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

db/seeders/20250416132150-add-htr-token.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
module.exports = {
44
up: async (queryInterface) => {
5+
// Check if HTR token already exists
6+
const [existing] = await queryInterface.sequelize.query(
7+
"SELECT id FROM token WHERE id = '00'"
8+
);
9+
10+
if (existing.length > 0) {
11+
console.log('HTR token already exists, skipping.');
12+
return;
13+
}
14+
515
// Count unique transactions for HTR
616
const [results] = await queryInterface.sequelize.query(
717
"SELECT COUNT(DISTINCT tx_id) AS count FROM tx_output WHERE token_id = '00'"
@@ -14,6 +24,7 @@ module.exports = {
1424
name: 'Hathor',
1525
symbol: 'HTR',
1626
transactions: htrTxCount,
27+
version: 0, // TokenVersion.NATIVE
1728
}]);
1829
},
1930

0 commit comments

Comments
 (0)