mirror of
https://github.com/CyberL1/MyMcRealms.git
synced 2024-11-13 18:08:23 -05:00
52 lines
1.9 KiB
C#
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");
|
|
}
|
|
}
|
|
}
|