mirror of
https://gitlab.com/Hukuta47/cartrix.git
synced 2026-12-05 20:40:55 +00:00
60 lines
1.8 KiB
C#
60 lines
1.8 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace CartriX.Api.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class Init2 : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Printers_Locations_locationId",
|
|
table: "Printers");
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "locationId",
|
|
table: "Printers",
|
|
type: "INTEGER",
|
|
nullable: false,
|
|
defaultValue: 0,
|
|
oldClrType: typeof(int),
|
|
oldType: "INTEGER",
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Printers_Locations_locationId",
|
|
table: "Printers",
|
|
column: "locationId",
|
|
principalTable: "Locations",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Printers_Locations_locationId",
|
|
table: "Printers");
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "locationId",
|
|
table: "Printers",
|
|
type: "INTEGER",
|
|
nullable: true,
|
|
oldClrType: typeof(int),
|
|
oldType: "INTEGER");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Printers_Locations_locationId",
|
|
table: "Printers",
|
|
column: "locationId",
|
|
principalTable: "Locations",
|
|
principalColumn: "id");
|
|
}
|
|
}
|
|
}
|