LANCommander/Migrations/20221229082813_AlterGameReq...

117 lines
3.8 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace LANCommander.Migrations
{
public partial class AlterGameRequiredFields : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Games_Companies_DeveloperId",
table: "Games");
migrationBuilder.DropForeignKey(
name: "FK_Games_Companies_PublisherId",
table: "Games");
migrationBuilder.AlterColumn<string>(
name: "SortTitle",
table: "Games",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT");
migrationBuilder.AlterColumn<Guid>(
name: "PublisherId",
table: "Games",
type: "TEXT",
nullable: true,
oldClrType: typeof(Guid),
oldType: "TEXT");
migrationBuilder.AlterColumn<Guid>(
name: "DeveloperId",
table: "Games",
type: "TEXT",
nullable: true,
oldClrType: typeof(Guid),
oldType: "TEXT");
migrationBuilder.AddForeignKey(
name: "FK_Games_Companies_DeveloperId",
table: "Games",
column: "DeveloperId",
principalTable: "Companies",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Games_Companies_PublisherId",
table: "Games",
column: "PublisherId",
principalTable: "Companies",
principalColumn: "Id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Games_Companies_DeveloperId",
table: "Games");
migrationBuilder.DropForeignKey(
name: "FK_Games_Companies_PublisherId",
table: "Games");
migrationBuilder.AlterColumn<string>(
name: "SortTitle",
table: "Games",
type: "TEXT",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<Guid>(
name: "PublisherId",
table: "Games",
type: "TEXT",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
oldClrType: typeof(Guid),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<Guid>(
name: "DeveloperId",
table: "Games",
type: "TEXT",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
oldClrType: typeof(Guid),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AddForeignKey(
name: "FK_Games_Companies_DeveloperId",
table: "Games",
column: "DeveloperId",
principalTable: "Companies",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Games_Companies_PublisherId",
table: "Games",
column: "PublisherId",
principalTable: "Companies",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}