ProjectLighthouse/ProjectLighthouse/Migrations/20230628043618_AddUserIdAndTimestampToScore.cs
Josh 70a66e6034
Migrate scores to use proper relationships (#830)
* 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
2023-08-19 07:32:38 +00:00

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");
}
}
}