using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DorkNet.Server.Migrations
{
///
public partial class Phase3RoomDataBlobs : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "CurrentDataBlobName",
table: "Rooms",
type: "TEXT",
maxLength: 128,
nullable: false,
defaultValue: "");
migrationBuilder.CreateTable(
name: "RoomDataBlobs",
columns: table => new
{
Id = table.Column(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
RoomId = table.Column(type: "INTEGER", nullable: false),
BlobName = table.Column(type: "TEXT", maxLength: 128, nullable: false),
UploadedByPlayerId = table.Column(type: "INTEGER", nullable: false),
UploadedAt = table.Column(type: "TEXT", nullable: false),
Bytes = table.Column(type: "BLOB", nullable: false),
ReferencedFilenamesCsv = table.Column(type: "TEXT", maxLength: 2048, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_RoomDataBlobs", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_RoomDataBlobs_BlobName",
table: "RoomDataBlobs",
column: "BlobName",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_RoomDataBlobs_RoomId",
table: "RoomDataBlobs",
column: "RoomId");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "RoomDataBlobs");
migrationBuilder.DropColumn(
name: "CurrentDataBlobName",
table: "Rooms");
}
}
}