using System.Text.Json; using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace Minecraft_Realms_Emulator.Migrations { /// public partial class Backups : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Backups", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), WorldId = table.Column(type: "integer", nullable: false), BackupId = table.Column(type: "text", nullable: false), LastModifiedDate = table.Column(type: "bigint", nullable: false), Size = table.Column(type: "integer", nullable: false), Metadata = table.Column(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"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Backups"); } } }