1
0
mirror of https://github.com/CyberL1/MyMcRealms.git synced 2024-09-19 16:02:51 -04:00
MyMcRealms/Minecraft-Realms-Emulator/Migrations/20240214154708_Backups.cs
2024-04-20 09:20:30 +02:00

52 lines
1.9 KiB
C#

using System.Text.Json;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Minecraft_Realms_Emulator.Migrations
{
/// <inheritdoc />
public partial class Backups : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Backups",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
WorldId = table.Column<int>(type: "integer", nullable: false),
BackupId = table.Column<string>(type: "text", nullable: false),
LastModifiedDate = table.Column<long>(type: "bigint", nullable: false),
Size = table.Column<int>(type: "integer", nullable: false),
Metadata = table.Column<JsonDocument>(type: "jsonb", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Backups", x => x.Id);
table.ForeignKey(
name: "FK_Backups_Worlds_WorldId",
column: x => x.WorldId,
principalTable: "Worlds",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Backups_WorldId",
table: "Backups",
column: "WorldId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Backups");
}
}
}