feat: turn address into a coin-agnostic solution

This commit is contained in:
Sérgio Salgado 2022-10-04 19:28:18 +01:00 committed by Rafael
parent c5f3caab2f
commit 473bb15c24
9 changed files with 122 additions and 177 deletions

View file

@ -0,0 +1,18 @@
var db = require('./db')
exports.up = function (next) {
var sql = [
`CREATE TABLE blacklist_temp (
address TEXT NOT NULL UNIQUE
)`
`INSERT INTO blacklist_temp (address) SELECT DISTINCT address FROM blacklist`,
`DROP TABLE blacklist`,
`ALTER TABLE blacklist_temp RENAME TO blacklist`
]
db.multi(sql, next)
}
exports.down = function (next) {
next()
}