Skip to content

Commit cc0dc17

Browse files
committed
Adjust migration.
1 parent 832d6c5 commit cc0dc17

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

Arrowgene.Ddon.Database/Sql/Core/Migration/00000044_LightQuestRotationMigration.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,26 @@ public bool Migrate(IDatabase db, DbConnection conn)
4747
}
4848
);
4949

50+
// Drop existing light quests.
51+
db.ExecuteNonQuery(conn, "DELETE FROM ddon_quest_progress WHERE quest_schedule_id > 40000000 AND quest_schedule_id < 49999999;", command => { });
52+
5053
foreach(var progress in values)
5154
{
5255
uint questId = progress.QuestScheduleId;
5356

5457
if (!QuestMapping.TryGetValue(questId, out var newSchedule))
5558
{
56-
Logger.Error($"Failing to migrate quest progress {questId}, step {progress.Step} for commonID {progress.CharacterCommonId}");
59+
Logger.Error($"Failed to migrate quest progress {questId}, step {progress.Step} for commonID {progress.CharacterCommonId}");
60+
db.ExecuteNonQuery(conn,
61+
"""
62+
DELETE FROM "ddon_quest_progress" WHERE "character_common_id"=@character_common_id AND "quest_schedule_id"=@quest_schedule_id;
63+
""",
64+
command =>
65+
{
66+
db.AddParameter(command, "character_common_id", progress.CharacterCommonId);
67+
db.AddParameter(command, "quest_schedule_id", progress.QuestScheduleId);
68+
}
69+
);
5770
continue;
5871
}
5972

0 commit comments

Comments
 (0)