Skip to content

Commit

Permalink
Merge pull request #284 from aternosorg/update
Browse files Browse the repository at this point in the history
fix update for 0.4.0
  • Loading branch information
JulianVennen authored Jun 6, 2021
2 parents 0681be7 + b3c57d4 commit 5be9e08
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions update/0.4.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ const GuildConfig = require('../src/GuildConfig');
async function update() {
console.log('Starting update to v0.4.0');

console.log('Updating guild log channels')
console.log('Updating guild log channels');
await database.waitForConnection();
GuildConfig.init(database, null);
const guilds = await database.queryAll('SELECT id, config FROM guilds');
let updated = 0;

for (const guild of guilds) {
const gc = new GuildConfig(guild.id, guild.config);
const gc = new GuildConfig(guild.id, JSON.parse(guild.config));
if (gc.logChannel) {
gc.messageLogChannel = gc.logChannel;
await gc.save();
Expand Down

0 comments on commit 5be9e08

Please sign in to comment.