diff --git a/Iceshrimp.Backend/Core/Database/Migrations/v2024.1-beta4/20240527231353_AddNoteCombinedAltTextField.cs b/Iceshrimp.Backend/Core/Database/Migrations/v2024.1-beta4/20240527231353_AddNoteCombinedAltTextField.cs
index ffb7e163..e0d72159 100644
--- a/Iceshrimp.Backend/Core/Database/Migrations/v2024.1-beta4/20240527231353_AddNoteCombinedAltTextField.cs
+++ b/Iceshrimp.Backend/Core/Database/Migrations/v2024.1-beta4/20240527231353_AddNoteCombinedAltTextField.cs
@@ -13,14 +13,15 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
///
protected override void Up(MigrationBuilder migrationBuilder)
{
+ Console.WriteLine("Indexing drive file alt text, please hang tight!");
+ Console.WriteLine("This may take a long time (15-30 minutes), especially if your database is unusually large or you're running low end hardware.");
+
migrationBuilder.AddColumn(
name: "combinedAltText",
table: "note",
type: "text",
nullable: true);
-
- Console.WriteLine("Indexing drive file alt text, please hang tight!");
- Console.WriteLine("This may take a long time (15-30 minutes), especially if your database is unusually large or you're running low end hardware.");
+
migrationBuilder.Sql("""UPDATE note SET "combinedAltText"=(SELECT string_agg(comment, ' ') FROM drive_file WHERE id = ANY ("fileIds")) WHERE "fileIds" != '{}';""");
migrationBuilder.CreateIndex(