46 lines
1.8 KiB
C#
46 lines
1.8 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
namespace LiMan.DB.Migrations
|
|
{
|
|
public partial class AddFileAttach : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "FileAttach",
|
|
columns: table => new
|
|
{
|
|
IdxFileAttach = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
IdxTicket = table.Column<int>(type: "int", nullable: false),
|
|
DtEvent = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
OriginalName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
StorageName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
FullStoragePath = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_FileAttach", x => x.IdxFileAttach);
|
|
table.ForeignKey(
|
|
name: "FK_FileAttach_TicketLog_IdxTicket",
|
|
column: x => x.IdxTicket,
|
|
principalTable: "TicketLog",
|
|
principalColumn: "IdxTicket",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_FileAttach_IdxTicket",
|
|
table: "FileAttach",
|
|
column: "IdxTicket");
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "FileAttach");
|
|
}
|
|
}
|
|
}
|