using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace RR3CommunityServer.Migrations { /// public partial class AddLeaderboardsAndRecords : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "LeaderboardEntries", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), SynergyId = table.Column(type: "TEXT", nullable: false), PlayerName = table.Column(type: "TEXT", nullable: false), RecordType = table.Column(type: "TEXT", nullable: false), RecordCategory = table.Column(type: "TEXT", nullable: false), TrackName = table.Column(type: "TEXT", nullable: true), CarName = table.Column(type: "TEXT", nullable: true), TimeSeconds = table.Column(type: "REAL", nullable: false), SubmittedAt = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_LeaderboardEntries", x => x.Id); }); migrationBuilder.CreateTable( name: "PersonalRecords", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), SynergyId = table.Column(type: "TEXT", nullable: false), RecordType = table.Column(type: "TEXT", nullable: false), RecordCategory = table.Column(type: "TEXT", nullable: false), TrackName = table.Column(type: "TEXT", nullable: true), CarName = table.Column(type: "TEXT", nullable: true), BestTimeSeconds = table.Column(type: "REAL", nullable: false), AchievedAt = table.Column(type: "TEXT", nullable: false), PreviousBestTime = table.Column(type: "TEXT", nullable: true), ImprovementSeconds = table.Column(type: "REAL", nullable: true), TotalAttempts = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PersonalRecords", x => x.Id); }); migrationBuilder.UpdateData( table: "TimeTrials", keyColumn: "Id", keyValue: 1, columns: new[] { "EndDate", "StartDate" }, values: new object[] { new DateTime(2026, 3, 2, 1, 33, 39, 587, DateTimeKind.Utc).AddTicks(7946), new DateTime(2026, 2, 23, 1, 33, 39, 587, DateTimeKind.Utc).AddTicks(7944) }); migrationBuilder.UpdateData( table: "TimeTrials", keyColumn: "Id", keyValue: 2, columns: new[] { "EndDate", "StartDate" }, values: new object[] { new DateTime(2026, 3, 2, 1, 33, 39, 587, DateTimeKind.Utc).AddTicks(7954), new DateTime(2026, 2, 23, 1, 33, 39, 587, DateTimeKind.Utc).AddTicks(7954) }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "LeaderboardEntries"); migrationBuilder.DropTable( name: "PersonalRecords"); 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) }); } } }