Files
limanapp/LiMan.DB/Migrations/20211116113345_AddTicketModel.cs

53 lines
2.4 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace LiMan.DB.Migrations
{
public partial class AddTicketModel : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "TicketLog",
columns: table => new
{
IdxTicket = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
DtReq = table.Column<DateTime>(type: "datetime", nullable: false, defaultValue: DateTime.Now, defaultValueSql: "GETDATE()"),
Tipo = table.Column<int>(type: "int", nullable: false),
IdxLic = table.Column<int>(type: "int", nullable: false),
IdxSubLic = table.Column<int>(type: "int", nullable: false),
CodImpiego = table.Column<string>(type: "nvarchar(max)", nullable: true),
ContactEmail = table.Column<string>(type: "nvarchar(max)", nullable: true),
ContactPhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
ReqBody = table.Column<string>(type: "nvarchar(max)", nullable: true),
Status = table.Column<int>(type: "int", nullable: false),
SupplEmail = table.Column<string>(type: "nvarchar(max)", nullable: true),
SupplUserCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
SupplAnsw = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_TicketLog", x => x.IdxTicket);
table.ForeignKey(
name: "FK_TicketLog_Licenze_IdxLic",
column: x => x.IdxLic,
principalTable: "Licenze",
principalColumn: "IdxLic",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_TicketLog_IdxLic",
table: "TicketLog",
column: "IdxLic");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "TicketLog");
}
}
}