* Use a primary autoincrementing primary key because primary keys need to be unique * Cache whitelist on bot startup / only read from database once * "Externalize" whitelist checking to the messageCreate function.
This commit is contained in:
parent
c9d7a54e25
commit
ba88243dea
5 changed files with 56 additions and 46 deletions
|
@ -4,7 +4,8 @@ module.exports = async function () {
|
|||
return new Promise ((resolve, reject)=>{
|
||||
db.run(
|
||||
`CREATE TABLE IF NOT EXISTS whitelist (
|
||||
serverId TEXT PRIMARY KEY,
|
||||
Id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
serverId TEXT,
|
||||
command TEXT,
|
||||
dateAdded INTEGER)`,
|
||||
(err) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue