70 lines
2.8 KiB
C#
70 lines
2.8 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace LANCommander.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddGameCustomFields : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "GameCustomField",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
|
Name = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false),
|
|
Value = table.Column<string>(type: "TEXT", maxLength: 1024, nullable: false),
|
|
GameId = 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_GameCustomField", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_GameCustomField_Games_GameId",
|
|
column: x => x.GameId,
|
|
principalTable: "Games",
|
|
principalColumn: "Id");
|
|
table.ForeignKey(
|
|
name: "FK_GameCustomField_Users_CreatedById",
|
|
column: x => x.CreatedById,
|
|
principalTable: "Users",
|
|
principalColumn: "Id");
|
|
table.ForeignKey(
|
|
name: "FK_GameCustomField_Users_UpdatedById",
|
|
column: x => x.UpdatedById,
|
|
principalTable: "Users",
|
|
principalColumn: "Id");
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_GameCustomField_CreatedById",
|
|
table: "GameCustomField",
|
|
column: "CreatedById");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_GameCustomField_GameId",
|
|
table: "GameCustomField",
|
|
column: "GameId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_GameCustomField_UpdatedById",
|
|
table: "GameCustomField",
|
|
column: "UpdatedById");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "GameCustomField");
|
|
}
|
|
}
|
|
}
|