forked from cadence/out-of-your-element
Move bridge bot to its real ID in the database
This commit is contained in:
parent
0deb415511
commit
566b2a9d9e
2 changed files with 23 additions and 5 deletions
16
db/migrations/0011-move-bridge-bot-to-real-id.up.js
Normal file
16
db/migrations/0011-move-bridge-bot-to-real-id.up.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
a. If the bridge bot sim already has the correct ID:
|
||||
- No rows updated.
|
||||
|
||||
b. If the bridge bot sim has the wrong ID but there's no duplicate:
|
||||
- One row updated.
|
||||
|
||||
c. If the bridge bot sim has the wrong ID and there's a duplicate:
|
||||
- One row updated (replaces an existing row).
|
||||
*/
|
||||
|
||||
module.exports = async function(db) {
|
||||
const config = require("../../config")
|
||||
const id = Buffer.from(config.discordToken.split(".")[0], "base64").toString()
|
||||
db.prepare("UPDATE OR REPLACE sim SET user_id = ? WHERE user_id = '0'").run(id)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue