using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace LANCommander.Migrations
{
///
public partial class LinkGameServers : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "GameId",
table: "Servers",
type: "TEXT",
nullable: true);
migrationBuilder.AlterColumn(
name: "ApprovedOn",
table: "AspNetUsers",
type: "TEXT",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "TEXT");
migrationBuilder.CreateIndex(
name: "IX_Servers_GameId",
table: "Servers",
column: "GameId");
migrationBuilder.AddForeignKey(
name: "FK_Servers_Games_GameId",
table: "Servers",
column: "GameId",
principalTable: "Games",
principalColumn: "Id");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Servers_Games_GameId",
table: "Servers");
migrationBuilder.DropIndex(
name: "IX_Servers_GameId",
table: "Servers");
migrationBuilder.DropColumn(
name: "GameId",
table: "Servers");
migrationBuilder.AlterColumn(
name: "ApprovedOn",
table: "AspNetUsers",
type: "TEXT",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
oldClrType: typeof(DateTime),
oldType: "TEXT",
oldNullable: true);
}
}
}