PIbd-22-Stroev-V.M.-Plumbin.../PlumbingRepair/PlumbingRepairDataBaseImplement/Migrations/20240506180952_WithMails.cs

49 lines
1.7 KiB
C#
Raw Permalink Normal View History

2024-05-06 22:28:13 +04:00
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PlumbingRepairDataBaseImplement.Migrations
{
/// <inheritdoc />
public partial class WithMails : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Messages",
columns: table => new
{
MessageId = table.Column<string>(type: "text", nullable: false),
ClientId = table.Column<int>(type: "integer", nullable: true),
SenderName = table.Column<string>(type: "text", nullable: false),
DateDelivery = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
Subject = table.Column<string>(type: "text", nullable: false),
Body = table.Column<string>(type: "text", 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");
}
}
}