mirror of
https://gitlab.com/Hukuta47/cartrix.git
synced 2026-12-05 20:40:55 +00:00
89 lines
2.7 KiB
C#
89 lines
2.7 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace CartriX.Api.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class Init3 : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Printers_PrinterTypes_typeid",
|
|
table: "Printers");
|
|
|
|
migrationBuilder.DropPrimaryKey(
|
|
name: "PK_PrinterTypes",
|
|
table: "PrinterTypes");
|
|
|
|
migrationBuilder.RenameTable(
|
|
name: "PrinterTypes",
|
|
newName: "PrintTypes");
|
|
|
|
migrationBuilder.RenameColumn(
|
|
name: "typeid",
|
|
table: "Printers",
|
|
newName: "printTypeid");
|
|
|
|
migrationBuilder.RenameIndex(
|
|
name: "IX_Printers_typeid",
|
|
table: "Printers",
|
|
newName: "IX_Printers_printTypeid");
|
|
|
|
migrationBuilder.AddPrimaryKey(
|
|
name: "PK_PrintTypes",
|
|
table: "PrintTypes",
|
|
column: "id");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Printers_PrintTypes_printTypeid",
|
|
table: "Printers",
|
|
column: "printTypeid",
|
|
principalTable: "PrintTypes",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Printers_PrintTypes_printTypeid",
|
|
table: "Printers");
|
|
|
|
migrationBuilder.DropPrimaryKey(
|
|
name: "PK_PrintTypes",
|
|
table: "PrintTypes");
|
|
|
|
migrationBuilder.RenameTable(
|
|
name: "PrintTypes",
|
|
newName: "PrinterTypes");
|
|
|
|
migrationBuilder.RenameColumn(
|
|
name: "printTypeid",
|
|
table: "Printers",
|
|
newName: "typeid");
|
|
|
|
migrationBuilder.RenameIndex(
|
|
name: "IX_Printers_printTypeid",
|
|
table: "Printers",
|
|
newName: "IX_Printers_typeid");
|
|
|
|
migrationBuilder.AddPrimaryKey(
|
|
name: "PK_PrinterTypes",
|
|
table: "PrinterTypes",
|
|
column: "id");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Printers_PrinterTypes_typeid",
|
|
table: "Printers",
|
|
column: "typeid",
|
|
principalTable: "PrinterTypes",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
}
|
|
}
|