Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

update existing rows when migration is ran

Swifty773f545cfd77
diff --git a/autogpt_platform/backend/migrations/20251016093049_add_full_text_search/migration.sql b/autogpt_platform/backend/migrations/20251016093049_add_full_text_search/migration.sql
index 7d3cd381ab..b3f90ebd3c 100644
--- a/autogpt_platform/backend/migrations/20251016093049_add_full_text_search/migration.sql
+++ b/autogpt_platform/backend/migrations/20251016093049_add_full_text_search/migration.sql
@@ -28,6 +28,14 @@ BEFORE INSERT OR UPDATE ON "StoreListingVersion"
FOR EACH ROW
EXECUTE FUNCTION update_tsvector_column();
+UPDATE "StoreListingVersion"
+SET search = to_tsvector('english',
+ COALESCE(name, '') || ' ' ||
+ COALESCE(description, '') || ' ' ||
+ COALESCE("subHeading", '')
+)
+WHERE search IS NULL;
+
-- Drop and recreate the StoreAgent view with isAvailable field
DROP VIEW IF EXISTS "StoreAgent";