LANCommander/LANCommander/Migrations/20230815054532_AddServerLogModel.cs
2023-08-15 20:15:53 -05:00

82 lines
3.2 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace LANCommander.Migrations
{
/// <inheritdoc />
public partial class AddServerLogModel : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ServerLog",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
Name = table.Column<string>(type: "TEXT", nullable: false),
Path = table.Column<string>(type: "TEXT", nullable: false),
ServerId = table.Column<Guid>(type: "TEXT", nullable: false),
ServerId1 = 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_ServerLog", x => x.Id);
table.ForeignKey(
name: "FK_ServerLog_AspNetUsers_CreatedById",
column: x => x.CreatedById,
principalTable: "AspNetUsers",
principalColumn: "Id");
table.ForeignKey(
name: "FK_ServerLog_AspNetUsers_UpdatedById",
column: x => x.UpdatedById,
principalTable: "AspNetUsers",
principalColumn: "Id");
table.ForeignKey(
name: "FK_ServerLog_Servers_ServerId",
column: x => x.ServerId,
principalTable: "Servers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ServerLog_Servers_ServerId1",
column: x => x.ServerId1,
principalTable: "Servers",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_ServerLog_CreatedById",
table: "ServerLog",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_ServerLog_ServerId",
table: "ServerLog",
column: "ServerId");
migrationBuilder.CreateIndex(
name: "IX_ServerLog_ServerId1",
table: "ServerLog",
column: "ServerId1");
migrationBuilder.CreateIndex(
name: "IX_ServerLog_UpdatedById",
table: "ServerLog",
column: "UpdatedById");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ServerLog");
}
}
}