mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-21 16:25:28 +03:00
rework additional repositories
This commit is contained in:
@@ -69,7 +69,7 @@ namespace Emby.Server.Implementations.Data
|
||||
//}
|
||||
|
||||
db.ExecuteAll(string.Join(";", queries));
|
||||
|
||||
|
||||
return db;
|
||||
}
|
||||
|
||||
@@ -119,5 +119,27 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void AddColumn(IDatabaseConnection connection, string table, string columnName, string type)
|
||||
{
|
||||
foreach (var row in connection.Query("PRAGMA table_info(" + table + ")"))
|
||||
{
|
||||
if (row[1].SQLiteType != SQLiteType.Null)
|
||||
{
|
||||
var name = row[1].ToString();
|
||||
|
||||
if (string.Equals(name, columnName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
connection.ExecuteAll(string.Join(";", new string[]
|
||||
{
|
||||
"alter table " + table,
|
||||
"add column " + columnName + " " + type + " NULL"
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user