mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
Rely on storage.DeleteDatabase for guaranteed database deletion
Relies on https://github.com/ppy/osu-framework/pull/1100 being merged for most effectiveness.
This commit is contained in:
@ -9,11 +9,19 @@ namespace osu.Game.Database
|
||||
{
|
||||
private readonly GameHost host;
|
||||
|
||||
private const string database_name = @"client";
|
||||
|
||||
public DatabaseContextFactory(GameHost host)
|
||||
{
|
||||
this.host = host;
|
||||
}
|
||||
|
||||
public OsuDbContext GetContext() => new OsuDbContext(host.Storage.GetDatabaseConnectionString(@"client"));
|
||||
public OsuDbContext GetContext() => new OsuDbContext(host.Storage.GetDatabaseConnectionString(database_name));
|
||||
|
||||
public void ResetDatabase()
|
||||
{
|
||||
// todo: we probably want to make sure there are no active contexts before performing this operation.
|
||||
host.Storage.DeleteDatabase(database_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user