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,35 +13,9 @@ namespace NadekoBot.Migrations
migrationBuilder.Sql("UPDATE Permission SET NextId = NULL;");
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.Sql("DELETE FROM FilteredWord WHERE GuildConfigId NOT IN (SELECT Id from GuildConfigs)");
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.DropColumn(
name: "ChannelCreated",
@@ -107,6 +81,39 @@ namespace NadekoBot.Migrations
name: "VoicePresenceChannelId",
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(
name: "AutoAssignRoleId",
table: "GuildConfigs");

View File

@@ -19,7 +19,7 @@ namespace NadekoBot.Services
private readonly IBotCredentials _creds;
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 Library => "Discord.Net";