mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 21:07:18 +09:00
Run database migration unconditionally, remove downwards migration
This commit is contained in:
parent
710b0a4664
commit
eb9199e07a
@ -11,10 +11,6 @@ namespace osu.Game.Migrations
|
|||||||
string sanitized = Path.DirectorySeparatorChar.ToString();
|
string sanitized = Path.DirectorySeparatorChar.ToString();
|
||||||
string standardized = "/";
|
string standardized = "/";
|
||||||
|
|
||||||
// If we are not on Windows, no changes are needed.
|
|
||||||
if (string.Equals(standardized, sanitized, StringComparison.Ordinal))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Escaping \ does not seem to be needed.
|
// Escaping \ does not seem to be needed.
|
||||||
migrationBuilder.Sql($"UPDATE `BeatmapInfo` SET `Path` = REPLACE(`Path`, '{sanitized}', '{standardized}')");
|
migrationBuilder.Sql($"UPDATE `BeatmapInfo` SET `Path` = REPLACE(`Path`, '{sanitized}', '{standardized}')");
|
||||||
migrationBuilder.Sql($"UPDATE `BeatmapMetadata` SET `AudioFile` = REPLACE(`AudioFile`, '{sanitized}', '{standardized}')");
|
migrationBuilder.Sql($"UPDATE `BeatmapMetadata` SET `AudioFile` = REPLACE(`AudioFile`, '{sanitized}', '{standardized}')");
|
||||||
@ -25,18 +21,6 @@ namespace osu.Game.Migrations
|
|||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
{
|
{
|
||||||
string sanitized = Path.DirectorySeparatorChar.ToString();
|
|
||||||
string standardized = "/";
|
|
||||||
|
|
||||||
// If we are not on Windows, no changes are needed.
|
|
||||||
if (string.Equals(standardized, sanitized, StringComparison.Ordinal))
|
|
||||||
return;
|
|
||||||
|
|
||||||
migrationBuilder.Sql($"UPDATE `BeatmapInfo` SET `Path` = REPLACE(`Path`, '{standardized}', '{sanitized}')");
|
|
||||||
migrationBuilder.Sql($"UPDATE `BeatmapMetadata` SET `AudioFile` = REPLACE(`AudioFile`, '{standardized}', '{sanitized}')");
|
|
||||||
migrationBuilder.Sql($"UPDATE `BeatmapMetadata` SET `BackgroundFile` = REPLACE(`BackgroundFile`, '{standardized}', '{sanitized}')");
|
|
||||||
migrationBuilder.Sql($"UPDATE `BeatmapSetFileInfo` SET `Filename` = REPLACE(`Filename`, '{standardized}', '{sanitized}')");
|
|
||||||
migrationBuilder.Sql($"UPDATE `SkinFileInfo` SET `Filename` = REPLACE(`Filename`, '{standardized}', '{sanitized}')");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user