60 lines
1.8 KiB
C#
60 lines
1.8 KiB
C#
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace SewingDressesDatabaseImplement.Migrations
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
public partial class nullab : Migration
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropForeignKey(
|
|||
|
name: "FK_Orders_Implements_ImplementId",
|
|||
|
table: "Orders");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<int>(
|
|||
|
name: "ImplementId",
|
|||
|
table: "Orders",
|
|||
|
type: "int",
|
|||
|
nullable: true,
|
|||
|
oldClrType: typeof(int),
|
|||
|
oldType: "int");
|
|||
|
|
|||
|
migrationBuilder.AddForeignKey(
|
|||
|
name: "FK_Orders_Implements_ImplementId",
|
|||
|
table: "Orders",
|
|||
|
column: "ImplementId",
|
|||
|
principalTable: "Implements",
|
|||
|
principalColumn: "Id");
|
|||
|
}
|
|||
|
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropForeignKey(
|
|||
|
name: "FK_Orders_Implements_ImplementId",
|
|||
|
table: "Orders");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<int>(
|
|||
|
name: "ImplementId",
|
|||
|
table: "Orders",
|
|||
|
type: "int",
|
|||
|
nullable: false,
|
|||
|
defaultValue: 0,
|
|||
|
oldClrType: typeof(int),
|
|||
|
oldType: "int",
|
|||
|
oldNullable: true);
|
|||
|
|
|||
|
migrationBuilder.AddForeignKey(
|
|||
|
name: "FK_Orders_Implements_ImplementId",
|
|||
|
table: "Orders",
|
|||
|
column: "ImplementId",
|
|||
|
principalTable: "Implements",
|
|||
|
principalColumn: "Id",
|
|||
|
onDelete: ReferentialAction.Cascade);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|