84 lines
3.3 KiB
C#
84 lines
3.3 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace LANCommander.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddIssues : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "Issues",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
|
Description = table.Column<string>(type: "TEXT", nullable: false),
|
|
ResolvedOn = table.Column<DateTime>(type: "TEXT", nullable: true),
|
|
GameId = table.Column<Guid>(type: "TEXT", nullable: false),
|
|
ResolvedById = table.Column<Guid>(type: "TEXT", nullable: true),
|
|
CreatedOn = table.Column<DateTime>(type: "TEXT", nullable: false),
|
|
CreatedById = table.Column<Guid>(type: "TEXT", nullable: true),
|
|
UpdatedOn = table.Column<DateTime>(type: "TEXT", nullable: false),
|
|
UpdatedById = table.Column<Guid>(type: "TEXT", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Issues", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_Issues_AspNetUsers_CreatedById",
|
|
column: x => x.CreatedById,
|
|
principalTable: "AspNetUsers",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.SetNull);
|
|
table.ForeignKey(
|
|
name: "FK_Issues_AspNetUsers_ResolvedById",
|
|
column: x => x.ResolvedById,
|
|
principalTable: "AspNetUsers",
|
|
principalColumn: "Id");
|
|
table.ForeignKey(
|
|
name: "FK_Issues_AspNetUsers_UpdatedById",
|
|
column: x => x.UpdatedById,
|
|
principalTable: "AspNetUsers",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.SetNull);
|
|
table.ForeignKey(
|
|
name: "FK_Issues_Games_GameId",
|
|
column: x => x.GameId,
|
|
principalTable: "Games",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.SetNull);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Issues_CreatedById",
|
|
table: "Issues",
|
|
column: "CreatedById");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Issues_GameId",
|
|
table: "Issues",
|
|
column: "GameId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Issues_ResolvedById",
|
|
table: "Issues",
|
|
column: "ResolvedById");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Issues_UpdatedById",
|
|
table: "Issues",
|
|
column: "UpdatedById");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "Issues");
|
|
}
|
|
}
|
|
}
|