Files
nadekobot/NadekoBot.Core/Migrations/20210428140625_bot-settings-migration.cs
2021-09-06 21:29:22 +02:00

29 lines
1008 B
C#

using Microsoft.EntityFrameworkCore.Migrations;
namespace NadekoBot.Migrations
{
public partial class botsettingsmigration : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
// if this migration is running, it means the user had the database
// prior to this patch, therefore migraton to .yml is required
// so the default value is manually changed from true to false
// but if the user had the database, the snapshot default value
// (true) will be used
migrationBuilder.AddColumn<bool>(
name: "HasMigratedBotSettings",
table: "BotConfig",
nullable: false,
defaultValue: false);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "HasMigratedBotSettings",
table: "BotConfig");
}
}
}