Fixed some migration issues which arose due to invalid database state. Upped version to beta3

This commit is contained in:
Kwoth
2021-08-10 20:55:19 +02:00
parent 5990430d5a
commit 5e83d5570d
2 changed files with 38 additions and 31 deletions

View File

@@ -13,36 +13,10 @@ namespace NadekoBot.Migrations
migrationBuilder.Sql("UPDATE Permission SET NextId = NULL;"); migrationBuilder.Sql("UPDATE Permission SET NextId = NULL;");
migrationBuilder.DropTable( migrationBuilder.Sql("DELETE FROM FilteredWord WHERE GuildConfigId NOT IN (SELECT Id from GuildConfigs)");
name: "Permission"); migrationBuilder.Sql("DELETE FROM FilterChannelId WHERE GuildConfigId NOT IN (SELECT Id from GuildConfigs)");
migrationBuilder.Sql("DELETE FROM CommandCooldown WHERE GuildConfigId NOT IN (SELECT Id from GuildConfigs)");
migrationBuilder.DropTable(
name: "Stakes");
migrationBuilder.DropIndex(
name: "IX_GuildConfigs_RootPermissionId",
table: "GuildConfigs");
migrationBuilder.DropColumn(
name: "NotifyMessage",
table: "XpSettings");
migrationBuilder.DropColumn(
name: "XpRoleRewardExclusive",
table: "XpSettings");
migrationBuilder.DropColumn(
name: "Item",
table: "WaifuItem");
migrationBuilder.DropColumn(
name: "Price",
table: "WaifuItem");
migrationBuilder.DropColumn(
name: "UseCount",
table: "Quotes");
migrationBuilder.DropColumn( migrationBuilder.DropColumn(
name: "ChannelCreated", name: "ChannelCreated",
table: "LogSettings"); table: "LogSettings");
@@ -106,6 +80,39 @@ namespace NadekoBot.Migrations
migrationBuilder.DropColumn( migrationBuilder.DropColumn(
name: "VoicePresenceChannelId", name: "VoicePresenceChannelId",
table: "LogSettings"); table: "LogSettings");
// todo cleanup guildconfigs which have logsettings id set to null
migrationBuilder.Sql("UPDATE GuildConfigs SET LogSettingId = null WHERE LogSettingId NOT IN (SELECT Id from LogSettings)");
migrationBuilder.DropTable(
name: "Permission");
migrationBuilder.DropTable(
name: "Stakes");
migrationBuilder.DropIndex(
name: "IX_GuildConfigs_RootPermissionId",
table: "GuildConfigs");
migrationBuilder.DropColumn(
name: "NotifyMessage",
table: "XpSettings");
migrationBuilder.DropColumn(
name: "XpRoleRewardExclusive",
table: "XpSettings");
migrationBuilder.DropColumn(
name: "Item",
table: "WaifuItem");
migrationBuilder.DropColumn(
name: "Price",
table: "WaifuItem");
migrationBuilder.DropColumn(
name: "UseCount",
table: "Quotes");
migrationBuilder.DropColumn( migrationBuilder.DropColumn(
name: "AutoAssignRoleId", name: "AutoAssignRoleId",

View File

@@ -19,7 +19,7 @@ namespace NadekoBot.Services
private readonly IBotCredentials _creds; private readonly IBotCredentials _creds;
private readonly DateTime _started; private readonly DateTime _started;
public const string BotVersion = "3.0.0-beta2"; public const string BotVersion = "3.0.0-beta3";
public string Author => "Kwoth#2452"; public string Author => "Kwoth#2452";
public string Library => "Discord.Net"; public string Library => "Discord.Net";