49 lines
1.4 KiB
C#
49 lines
1.4 KiB
C#
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace ComputerShopDatabaseImplement.Migrations
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
public partial class clientmigration2 : Migration
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.AddColumn<int>(
|
|||
|
name: "ClientId",
|
|||
|
table: "Components",
|
|||
|
type: "int",
|
|||
|
nullable: true);
|
|||
|
|
|||
|
migrationBuilder.CreateIndex(
|
|||
|
name: "IX_Components_ClientId",
|
|||
|
table: "Components",
|
|||
|
column: "ClientId");
|
|||
|
|
|||
|
migrationBuilder.AddForeignKey(
|
|||
|
name: "FK_Components_Clients_ClientId",
|
|||
|
table: "Components",
|
|||
|
column: "ClientId",
|
|||
|
principalTable: "Clients",
|
|||
|
principalColumn: "Id");
|
|||
|
}
|
|||
|
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropForeignKey(
|
|||
|
name: "FK_Components_Clients_ClientId",
|
|||
|
table: "Components");
|
|||
|
|
|||
|
migrationBuilder.DropIndex(
|
|||
|
name: "IX_Components_ClientId",
|
|||
|
table: "Components");
|
|||
|
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "ClientId",
|
|||
|
table: "Components");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|