using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DXApp.TemplateKitProject.Migrations
{
///
public partial class AddInvoiceAttachments : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "InvoiceAttachments",
columns: table => new
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ZugferdInvoiceId = table.Column(type: "int", nullable: false),
OriginalFileName = table.Column(type: "nvarchar(max)", nullable: true),
SavedFilePath = table.Column(type: "nvarchar(max)", nullable: true),
FileSizeBytes = table.Column(type: "bigint", nullable: false),
IsZugferdXml = table.Column(type: "bit", nullable: false),
ExtractedAt = table.Column(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_InvoiceAttachments", x => x.Id);
table.ForeignKey(
name: "FK_InvoiceAttachments_ZugferdInvoices_ZugferdInvoiceId",
column: x => x.ZugferdInvoiceId,
principalTable: "ZugferdInvoices",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_InvoiceAttachments_ZugferdInvoiceId",
table: "InvoiceAttachments",
column: "ZugferdInvoiceId");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "InvoiceAttachments");
}
}
}