From 3730691ba2d3cb935f2d5bdf668c591a456c1d3f Mon Sep 17 00:00:00 2001 From: TheEssem Date: Tue, 29 Dec 2020 20:33:51 -0600 Subject: [PATCH] Final fixes --- docker-compose.yml | 2 -- utils/convertdb.js | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 043baee..317d02e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,8 +16,6 @@ services: environment: OUTPUT: /home/esmBot/help TEMPDIR: /home/esmBot/temp - - MONGO: mongodb://mongo:27017/esmBot # chrome remote debugger can only be accessed over localhost or IP CHROME: 172.20.0.4:9222 links: diff --git a/utils/convertdb.js b/utils/convertdb.js index 0308f8e..610b0e2 100644 --- a/utils/convertdb.js +++ b/utils/convertdb.js @@ -30,9 +30,9 @@ const Global = mongoose.model("Global", globalSchema); for (const guild of guilds) { console.log(guild.tagsDisabled); if ((await pool.query("SELECT * FROM guilds WHERE guild_id = $1", [guild.id])).rows.length !== 0) { - await pool.query("UPDATE guilds SET tags = $1, prefix = $2, warns = $3, disabled = $4, tags_disabled = $5 WHERE guild_id = $6", [guild.tags, guild.prefix, {}, guild.disabled ? guild.disabled : guild.disabledChannels, guild.tagsDisabled === undefined ? false : guild.tagsDisabled, guild.id]); + await pool.query("UPDATE guilds SET tags = $1, prefix = $2, warns = $3, disabled = $4, tags_disabled = $5 WHERE guild_id = $6", [guild.tags, guild.prefix.substring(0, 15), {}, guild.disabled ? guild.disabled : guild.disabledChannels, guild.tagsDisabled === undefined ? false : guild.tagsDisabled, guild.id]); } else { - await pool.query("INSERT INTO guilds (guild_id, tags, prefix, warns, disabled, tags_disabled) VALUES ($1, $2, $3, $4, $5, $6)", [guild.id, guild.tags, guild.prefix, {}, guild.disabled ? guild.disabled : guild.disabledChannels, guild.tagsDisabled === undefined ? false : guild.tagsDisabled]); + await pool.query("INSERT INTO guilds (guild_id, tags, prefix, warns, disabled, tags_disabled) VALUES ($1, $2, $3, $4, $5, $6)", [guild.id, guild.tags, guild.prefix.substring(0, 15), {}, guild.disabled ? guild.disabled : guild.disabledChannels, guild.tagsDisabled === undefined ? false : guild.tagsDisabled]); } console.log(`Migrated guild with ID ${guild.id}`); }