PIbd-21_Kouvshinoff_T._A._A.../AutomobilePlant/AutomobilePlantDatabaseImplement/Migrations/20240504192703_MbINeedIt7Laba.cs

49 lines
1.8 KiB
C#
Raw Normal View History

2024-05-05 00:23:11 +04:00
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AutomobilePlantDatabaseImplement.Migrations
{
/// <inheritdoc />
public partial class MbINeedIt7Laba : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Messages",
columns: table => new
{
MessageId = table.Column<string>(type: "nvarchar(450)", nullable: false),
ClientId = table.Column<int>(type: "int", nullable: true),
SenderName = table.Column<string>(type: "nvarchar(max)", nullable: false),
DateDelivery = table.Column<DateTime>(type: "datetime2", nullable: false),
Subject = table.Column<string>(type: "nvarchar(max)", nullable: false),
Body = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Messages", x => x.MessageId);
table.ForeignKey(
name: "FK_Messages_Clients_ClientId",
column: x => x.ClientId,
principalTable: "Clients",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_Messages_ClientId",
table: "Messages",
column: "ClientId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Messages");
}
}
}