Files
rr3-server/RR3CommunityServer/Migrations/20260222074748_AddPlayerSavesAndConfig.cs
Daniel Elliott e839064b35 Add Phase 1 critical endpoints: Config & Save/Load system
- Added ConfigController with 4 endpoints:
  - getGameConfig: Server config, feature flags, URLs
  - getServerTime: UTC timestamps
  - getFeatureFlags: Feature toggles
  - getServerStatus: Health check

- Added save/load system to ProgressionController:
  - POST /save/{synergyId}: Save JSON blob
  - GET /save/{synergyId}/load: Load JSON blob
  - Version tracking and timestamps

- Added PlayerSave entity to database:
  - Stores arbitrary JSON game state
  - Version tracking (increments on save)
  - LastModified timestamps

- Updated appsettings.json:
  - ServerSettings section (version, URLs, MOTD)
  - FeatureFlags section (7 feature toggles)

- Created migration: AddPlayerSavesAndConfig
- Updated ApiModels with new DTOs
- All endpoints tested and working

Phase 1 objectives complete:
 Synergy ID generation (already existed)
 Configuration endpoints (new)
 Save/load system (new)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-21 23:53:43 -08:00

68 lines
2.9 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RR3CommunityServer.Migrations
{
/// <inheritdoc />
public partial class AddPlayerSavesAndConfig : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "PlayerSaves",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
SynergyId = table.Column<string>(type: "TEXT", nullable: false),
SaveDataJson = table.Column<string>(type: "TEXT", nullable: false),
Version = table.Column<long>(type: "INTEGER", nullable: false),
LastModified = table.Column<DateTime>(type: "TEXT", nullable: false),
CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PlayerSaves", x => x.Id);
});
migrationBuilder.UpdateData(
table: "TimeTrials",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "EndDate", "StartDate" },
values: new object[] { new DateTime(2026, 3, 1, 7, 47, 46, 836, DateTimeKind.Utc).AddTicks(7182), new DateTime(2026, 2, 22, 7, 47, 46, 836, DateTimeKind.Utc).AddTicks(7180) });
migrationBuilder.UpdateData(
table: "TimeTrials",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "EndDate", "StartDate" },
values: new object[] { new DateTime(2026, 3, 1, 7, 47, 46, 836, DateTimeKind.Utc).AddTicks(7192), new DateTime(2026, 2, 22, 7, 47, 46, 836, DateTimeKind.Utc).AddTicks(7191) });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PlayerSaves");
migrationBuilder.UpdateData(
table: "TimeTrials",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "EndDate", "StartDate" },
values: new object[] { new DateTime(2026, 2, 27, 17, 54, 50, 315, DateTimeKind.Utc).AddTicks(3387), new DateTime(2026, 2, 20, 17, 54, 50, 315, DateTimeKind.Utc).AddTicks(3384) });
migrationBuilder.UpdateData(
table: "TimeTrials",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "EndDate", "StartDate" },
values: new object[] { new DateTime(2026, 2, 27, 17, 54, 50, 315, DateTimeKind.Utc).AddTicks(3395), new DateTime(2026, 2, 20, 17, 54, 50, 315, DateTimeKind.Utc).AddTicks(3395) });
}
}
}