mirror of
https://github.com/osukey/osukey.git
synced 2025-05-31 02:17:34 +09:00
Simplify migration to not rely on old/dynamic schema
This commit is contained in:
parent
5c113ddb03
commit
c50ea89bc9
@ -869,17 +869,11 @@ namespace osu.Game.Database
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 26:
|
case 26:
|
||||||
// Add ScoreInfo.BeatmapHash property to ensure the score corresponds to the version of beatmap it should
|
// Add ScoreInfo.BeatmapHash property to ensure scores correspond to the correct version of beatmap.
|
||||||
// See: https://github.com/ppy/osu/issues/22062
|
var scores = migration.NewRealm.All<ScoreInfo>();
|
||||||
string scoreInfoName = getMappedOrOriginalName(typeof(ScoreInfo));
|
|
||||||
|
|
||||||
var oldScoreInfos = migration.OldRealm.DynamicApi.All(scoreInfoName);
|
foreach (var score in scores)
|
||||||
var newScoreInfos = migration.NewRealm.All<ScoreInfo>();
|
score.BeatmapHash = score.BeatmapInfo.Hash;
|
||||||
|
|
||||||
for (int i = 0; i < newScoreInfos.Count(); i++)
|
|
||||||
{
|
|
||||||
newScoreInfos.ElementAt(i).BeatmapHash = oldScoreInfos.ElementAt(i).BeatmapInfo.Hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user