Merge pull request #10230 from cvium/fix_migrations

pull/10239/head
Claus Vium 1 year ago committed by GitHub
commit 0179cea622
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -63,7 +63,10 @@ namespace Jellyfin.Server.Migrations.Routines
var dataPath = _paths.DataPath;
using (var connection = new SqliteConnection($"Filename={Path.Combine(dataPath, DbFilename)}"))
{
connection.Open();
using var userDbConnection = new SqliteConnection($"Filename={Path.Combine(dataPath, "users.db")}");
userDbConnection.Open();
_logger.LogWarning("Migrating the activity database may take a while, do not stop Jellyfin.");
using var dbContext = _provider.CreateDbContext();

@ -58,6 +58,7 @@ namespace Jellyfin.Server.Migrations.Routines
var dataPath = _appPaths.DataPath;
using (var connection = new SqliteConnection($"Filename={Path.Combine(dataPath, DbFilename)}"))
{
connection.Open();
using var dbContext = _dbProvider.CreateDbContext();
var authenticatedDevices = connection.Query("SELECT * FROM Tokens");

@ -86,6 +86,7 @@ namespace Jellyfin.Server.Migrations.Routines
var dbFilePath = Path.Combine(_paths.DataPath, DbFilename);
using (var connection = new SqliteConnection($"Filename={dbFilePath}"))
{
connection.Open();
using var dbContext = _provider.CreateDbContext();
var results = connection.Query("SELECT * FROM userdisplaypreferences");

@ -66,7 +66,8 @@ namespace Jellyfin.Server.Migrations.Routines
// Migrate parental rating strings to new levels
_logger.LogInformation("Recalculating parental rating levels based on rating string.");
using (var connection = new SqliteConnection($"Filename={dbPath}"))
using var connection = new SqliteConnection($"Filename={dbPath}");
connection.Open();
using (var transaction = connection.BeginTransaction())
{
var queryResult = connection.Query("SELECT DISTINCT OfficialRating FROM TypedBaseItems");

@ -66,6 +66,7 @@ namespace Jellyfin.Server.Migrations.Routines
using (var connection = new SqliteConnection($"Filename={Path.Combine(dataPath, DbFilename)}"))
{
connection.Open();
var dbContext = _provider.CreateDbContext();
var queryResult = connection.Query("SELECT * FROM LocalUsersv2");

@ -38,7 +38,8 @@ namespace Jellyfin.Server.Migrations.Routines
{
var dataPath = _paths.DataPath;
var dbPath = Path.Combine(dataPath, DbFilename);
using (var connection = new SqliteConnection($"Filename={dbPath}"))
using var connection = new SqliteConnection($"Filename={dbPath}");
connection.Open();
using (var transaction = connection.BeginTransaction())
{
// Query the database for the ids of duplicate extras

Loading…
Cancel
Save