LANCommander/LANCommander.Launcher.Data/Migrations/20260212030932_AddTools.cs
2026-02-12 18:58:40 -06:00

76 lines
3.1 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace LANCommander.Launcher.Data.Migrations
{
/// <inheritdoc />
public partial class AddTools : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Tools",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
Name = table.Column<string>(type: "TEXT", nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: true),
Notes = table.Column<string>(type: "TEXT", nullable: true),
Installed = table.Column<bool>(type: "INTEGER", nullable: false),
InstallDirectory = table.Column<string>(type: "TEXT", nullable: true),
InstalledVersion = table.Column<string>(type: "TEXT", nullable: true),
InstalledOn = table.Column<DateTime>(type: "TEXT", nullable: true),
LatestVersion = table.Column<string>(type: "TEXT", nullable: true),
ImportedOn = table.Column<DateTime>(type: "TEXT", nullable: false),
CreatedOn = table.Column<DateTime>(type: "TEXT", nullable: false),
UpdatedOn = table.Column<DateTime>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Tools", x => x.Id);
});
migrationBuilder.CreateTable(
name: "GameTool",
columns: table => new
{
GamesId = table.Column<Guid>(type: "TEXT", nullable: false),
ToolsId = table.Column<Guid>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_GameTool", x => new { x.GamesId, x.ToolsId });
table.ForeignKey(
name: "FK_GameTool_Games_GamesId",
column: x => x.GamesId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_GameTool_Tools_ToolsId",
column: x => x.ToolsId,
principalTable: "Tools",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_GameTool_ToolsId",
table: "GameTool",
column: "ToolsId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "GameTool");
migrationBuilder.DropTable(
name: "Tools");
}
}
}