mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-19 11:41:30 +00:00
* Initial work for score migration * Finish score migration * Implement suggested changes from code review * Make Score Timestamp default the current time * Chunk insertions to reduce packet size and give all scores the same Timestamp * Fix serialization of GameScore * Break score ties by time then scoreId * Make lighthouse score migration not dependent on current score implementation
42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
using LBPUnion.ProjectLighthouse.Database;
|
|
using LBPUnion.ProjectLighthouse.Helpers;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace ProjectLighthouse.Migrations
|
|
{
|
|
[DbContext(typeof(DatabaseContext))]
|
|
[Migration("20230628043618_AddUserIdAndTimestampToScore")]
|
|
public partial class AddUserIdAndTimestampToScore : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<long>(
|
|
name: "Timestamp",
|
|
table: "Scores",
|
|
type: "bigint",
|
|
nullable: false,
|
|
defaultValue: 0L);
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "UserId",
|
|
table: "Scores",
|
|
type: "int",
|
|
nullable: false,
|
|
defaultValue: 0);
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "Timestamp",
|
|
table: "Scores");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "UserId",
|
|
table: "Scores");
|
|
}
|
|
}
|
|
}
|