feat: turn address into a coin-agnostic solution
This commit is contained in:
parent
c5f3caab2f
commit
473bb15c24
9 changed files with 122 additions and 177 deletions
18
migrations/1664907000312-coin-agnostic-blacklist.js
Normal file
18
migrations/1664907000312-coin-agnostic-blacklist.js
Normal 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()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue