using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ElectronicsShopDataBaseImplement.Migrations
{
///
public partial class Migration03 : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Messages");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Messages",
columns: table => new
{
MessageID = table.Column(type: "nvarchar(450)", nullable: false),
ClientID = table.Column(type: "int", nullable: true),
Body = table.Column(type: "nvarchar(max)", nullable: false),
DateDelivery = table.Column(type: "datetime2", nullable: false),
SenderName = table.Column(type: "nvarchar(max)", nullable: false),
Subject = table.Column(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");
}
}
}