console.log('!!! This migration has a race condition when run from the `npm run migrate` command. If thats how this was called, please re-run this migration manually.\n!!! Run `npm run v3-manual` to do so');
varbansdb=newdirty('./config/bans.db')
bansdb.on('load',async()=>{
bansdb.forEach(async(key,val)=>{
letips=Object.keys(val);
for(vari=0;i<ips.length;i++){
awaitdb.query('INSERT INTO ch_bans (channel, target, time, length) VALUES ('+db.raw.escape(key)+', '+db.raw.escape(ips[i])+', '+val[ips[i]].time+', '+val[ips[i]].length+')');
}
});
awaitdb.query('INSERT INTO db_meta (version) VALUES (3)');
console.log('Done migrating bans.db');
console.log('If this was a manual migration, you can kill the process now.');