mirror of
https://gitlab.com/Hukuta47/cartrix.git
synced 2026-12-05 20:40:55 +00:00
51 lines
1.4 KiB
C#
51 lines
1.4 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.AddColumn<int>(
|
|
name: "typeid",
|
|
table: "Printers",
|
|
type: "INTEGER",
|
|
nullable: false,
|
|
defaultValue: 0);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Printers_typeid",
|
|
table: "Printers",
|
|
column: "typeid");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Printers_PrinterTypes_typeid",
|
|
table: "Printers",
|
|
column: "typeid",
|
|
principalTable: "PrinterTypes",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Printers_PrinterTypes_typeid",
|
|
table: "Printers");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_Printers_typeid",
|
|
table: "Printers");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "typeid",
|
|
table: "Printers");
|
|
}
|
|
}
|
|
}
|