47 lines
1.6 KiB
C#
47 lines
1.6 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace MoneyMap.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddCategoryMappings : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "Confidence",
|
|
table: "ReceiptLineItems");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "CategoryMappings",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
Category = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
Pattern = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
Priority = table.Column<int>(type: "int", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_CategoryMappings", x => x.Id);
|
|
});
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "CategoryMappings");
|
|
|
|
migrationBuilder.AddColumn<decimal>(
|
|
name: "Confidence",
|
|
table: "ReceiptLineItems",
|
|
type: "decimal(5,4)",
|
|
nullable: true);
|
|
}
|
|
}
|
|
}
|