1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 04:53:21 +08:00

Run database migration unconditionally, remove downwards migration

This commit is contained in:
HoLLy 2018-10-16 08:29:47 +02:00
parent 710b0a4664
commit eb9199e07a

View File

@ -11,10 +11,6 @@ namespace osu.Game.Migrations
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;
// Escaping \ does not seem to be needed.
migrationBuilder.Sql($"UPDATE `BeatmapInfo` SET `Path` = REPLACE(`Path`, '{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)
{
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}')");
}
}
}