50 lines
1.4 KiB
C#
50 lines
1.4 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace LANCommander.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddPageHierarchy : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "ParentId",
|
|
table: "Pages",
|
|
type: "TEXT",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Pages_ParentId",
|
|
table: "Pages",
|
|
column: "ParentId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Pages_Pages_ParentId",
|
|
table: "Pages",
|
|
column: "ParentId",
|
|
principalTable: "Pages",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Pages_Pages_ParentId",
|
|
table: "Pages");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_Pages_ParentId",
|
|
table: "Pages");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "ParentId",
|
|
table: "Pages");
|
|
}
|
|
}
|
|
}
|