mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
We are now using the new request service and storing the requests as json blobs Added the db migration code. This can be removed in the next few builds.
This commit is contained in:
parent
b62b7c1305
commit
2e8bb783d9
3 changed files with 17 additions and 4 deletions
|
@ -68,7 +68,7 @@ namespace PlexRequests.Core
|
|||
s.SaveSettings(defaultSettings);
|
||||
}
|
||||
|
||||
private void MigrateDb()
|
||||
private void MigrateDb() // TODO: Remove when no longer needed
|
||||
{
|
||||
var repo = new GenericRepository<RequestedModel>(Db);
|
||||
var records = repo.GetAll();
|
||||
|
@ -88,7 +88,20 @@ namespace PlexRequests.Core
|
|||
{
|
||||
throw new SqliteException("Could not migrate the DB!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (result.Count != requestedModels.Length)
|
||||
{
|
||||
throw new SqliteException("Could not migrate the DB! count is different");
|
||||
}
|
||||
|
||||
|
||||
// Now delete the old requests
|
||||
foreach (var oldRequest in requestedModels)
|
||||
{
|
||||
repo.Delete(oldRequest);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue