Files
DorkNet/DorkNet.Server/Data/Entities/CommunityBoardEntity.cs
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

29 lines
1.2 KiB
C#

namespace DorkNet.Server.Data.Entities;
/// <summary>
/// Single-row table holding the dorm community board state. Replaces
/// <c>data/community_board.json</c> on disk + in-memory cache so admin
/// edits propagate across replicas without a file-watcher invalidation
/// dance.
///
/// Only one row exists, with <see cref="Id"/> = 1. Reading is a single
/// SELECT (cheap; the board is one document, not paginated). Writing
/// is a single UPDATE — no synchronization needed because there's only
/// ever one row to contend on, and admin edits are rare.
/// </summary>
public class CommunityBoardEntity
{
/// <summary>Always 1. We model it as an int PK rather than a
/// composite or singleton-table pattern because EF Core needs a key
/// to track changes; pinning to id=1 keeps the upsert pattern
/// simple.</summary>
public int Id { get; set; } = 1;
/// <summary>JSON-serialised <c>CommunityBoardState</c>. Stored as
/// text rather than jsonb because we never query inside it — it's
/// loaded as a single blob and round-tripped to the client.</summary>
public string Json { get; set; } = "{}";
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}