Skip to content

Commit bbd5876

Browse files
authored
Merge pull request #21 from GeneralsOnlineDevelopmentTeam/seer/fix/daily-stats-day-rollover
fix(database): Prevent duplicate primary key on daily stats day rollover
2 parents d272e04 + bd36796 commit bbd5876

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

GenOnlineService/Database/Database.DailyStats.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
using Microsoft.EntityFrameworkCore.Metadata.Builders;
2121
using System.Text.Json;
2222

23-
// TODO_EFCORE: When updating this, make sure we preserve old ON DUPLICATE behavior, to overwrite the old data since day_of_year key will be re-used
2423
public class DailyStat
2524
{
2625
public DailyStat()
@@ -101,6 +100,7 @@ public static async Task SaveToDB(AppDbContext db)
101100
// Insert if new, otherwise update
102101
if (entity == null)
103102
{
103+
g_StatsContainer = new DailyStat();
104104
entity = g_StatsContainer;
105105
db.DailyStats.Add(entity);
106106
}

0 commit comments

Comments
 (0)