39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace SushiBarDatabaseImplement.Migrations
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
public partial class FixMessageKeyMigr : Migration
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.CreateIndex(
|
|||
|
name: "IX_Messages_ClientId",
|
|||
|
table: "Messages",
|
|||
|
column: "ClientId");
|
|||
|
|
|||
|
migrationBuilder.AddForeignKey(
|
|||
|
name: "FK_Messages_Clients_ClientId",
|
|||
|
table: "Messages",
|
|||
|
column: "ClientId",
|
|||
|
principalTable: "Clients",
|
|||
|
principalColumn: "Id");
|
|||
|
}
|
|||
|
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropForeignKey(
|
|||
|
name: "FK_Messages_Clients_ClientId",
|
|||
|
table: "Messages");
|
|||
|
|
|||
|
migrationBuilder.DropIndex(
|
|||
|
name: "IX_Messages_ClientId",
|
|||
|
table: "Messages");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|