Files
DorkNet/DorkNet.Server/Migrations/20260508165257_Phase10MessagesAndChat.cs
T
Alexa d471b418b9 Import march-2020-03-10 from private repo (scrubbed 2026-05-27)
Targets Rec Room 2020.03.10 client (also serves 2020.03.06).

Re-import after adding:
- DorkNet.ClientMod/dorknet-clientmod.json.template — config schema
  the launcher's manifest-driven patcher renders into UserData/.
- tools/build-patcher-zip.ps1 — produces dorknet-clientpatch-{key}.zip
  for v1-march-* Release uploads.
- .github/workflows/release.yml — on tag push publishes both
  dorknet-server-march_2020_03_10-win-x64.zip and
  dorknet-clientpatch-march_2020_03_10.zip as Release assets.

Same scrub rules as december; tools/build-patcher-zip.ps1 added to
the maintainer-side allow-list so it survives.
2026-05-27 01:06:12 +03:00

74 lines
2.9 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DorkNet.Server.Migrations
{
/// <inheritdoc />
public partial class Phase10MessagesAndChat : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ChatMessages",
columns: table => new
{
Id = table.Column<long>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
ThreadKey = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false),
SenderPlayerId = table.Column<long>(type: "INTEGER", nullable: false),
Body = table.Column<string>(type: "TEXT", maxLength: 2000, nullable: false),
SentAt = table.Column<DateTime>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ChatMessages", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Messages",
columns: table => new
{
Id = table.Column<long>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
SenderPlayerId = table.Column<long>(type: "INTEGER", nullable: false),
RecipientPlayerId = table.Column<long>(type: "INTEGER", nullable: false),
Body = table.Column<string>(type: "TEXT", maxLength: 2000, nullable: false),
SentAt = table.Column<DateTime>(type: "TEXT", nullable: false),
ReadAt = table.Column<DateTime>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Messages", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_ChatMessages_ThreadKey_SentAt",
table: "ChatMessages",
columns: new[] { "ThreadKey", "SentAt" });
migrationBuilder.CreateIndex(
name: "IX_Messages_RecipientPlayerId_SentAt",
table: "Messages",
columns: new[] { "RecipientPlayerId", "SentAt" });
migrationBuilder.CreateIndex(
name: "IX_Messages_SenderPlayerId_SentAt",
table: "Messages",
columns: new[] { "SenderPlayerId", "SentAt" });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ChatMessages");
migrationBuilder.DropTable(
name: "Messages");
}
}
}