mirror of https://gitgud.io/fatchan/jschan.git
property name fixes/change, category -> type, type -> range, now they reflect more what they actually are bantable updated, bit cleaner mixin bantables now more compact, will overflow (with scroll) and no text wrap close #446merge-requests/341/head
parent
578578af0f
commit
206dd3bc32
8 changed files with 66 additions and 29 deletions
@ -1,26 +1,56 @@ |
||||
'use strict'; |
||||
|
||||
module.exports = async(db, redis) => { |
||||
console.log('Addjusting bans to categorise between normal/bypass/pruned, required for ban upgrading capabilities'); |
||||
console.log('rename ban type -> range'); |
||||
await db.collection('bans').updateMany({}, { |
||||
'$rename': { |
||||
'type': 'range', |
||||
}, |
||||
}); |
||||
|
||||
console.log('change ban range from strings to number'); |
||||
await db.collection('bans').updateMany({ |
||||
'range': 'single' |
||||
}, { |
||||
'$set': { |
||||
'range': 0, |
||||
}, |
||||
}); |
||||
await db.collection('bans').updateMany({ |
||||
'range': 'qrange' |
||||
}, { |
||||
'$set': { |
||||
'range': 1, |
||||
}, |
||||
}); |
||||
await db.collection('bans').updateMany({ |
||||
'range': 'hrange' |
||||
}, { |
||||
'$set': { |
||||
'range': 2, |
||||
}, |
||||
}); |
||||
|
||||
console.log('set new ban.type based on ip/bypass/pruned'); |
||||
await db.collection('bans').updateMany({ |
||||
'ip.cloak': /\.IP$/ |
||||
}, { |
||||
'$set':{ |
||||
'category': 0, |
||||
'type': 0, |
||||
}, |
||||
}); |
||||
await db.collection('bans').updateMany({ |
||||
'ip.cloak': /\.BP$/ |
||||
}, { |
||||
'$set':{ |
||||
'category': 1, |
||||
'type': 1, |
||||
}, |
||||
}); |
||||
await db.collection('bans').updateMany({ |
||||
'ip.cloak': /\.PRUNED$/ |
||||
}, { |
||||
'$set':{ |
||||
'category': 2, |
||||
'type': 2, |
||||
}, |
||||
}); |
||||
}; |
||||
|
Loading…
Reference in new issue