Store MAX chat URLs for direct opens
This commit is contained in:
@@ -141,6 +141,22 @@ static async Task EnsureCompatibilitySchemaAsync(QMaxDbContext db)
|
||||
await connection.OpenAsync();
|
||||
}
|
||||
|
||||
var chatColumns = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
await using (var command = connection.CreateCommand())
|
||||
{
|
||||
command.CommandText = "PRAGMA table_info(Chats);";
|
||||
await using var reader = await command.ExecuteReaderAsync();
|
||||
while (await reader.ReadAsync())
|
||||
{
|
||||
chatColumns.Add(reader.GetString(1));
|
||||
}
|
||||
}
|
||||
|
||||
if (!chatColumns.Contains("WebUrl"))
|
||||
{
|
||||
await db.Database.ExecuteSqlRawAsync("ALTER TABLE Chats ADD COLUMN WebUrl TEXT;");
|
||||
}
|
||||
|
||||
var attachmentColumns = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
await using (var command = connection.CreateCommand())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user