From 0a59efe64a7d8c5715bbb6da984c130435885796 Mon Sep 17 00:00:00 2001 From: pablodanswer Date: Thu, 7 Nov 2024 09:47:43 -0800 Subject: [PATCH] account for malformatted starter messages --- ...b72ed7a5db0e_remove_description_from_starter_messages.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/alembic/versions/b72ed7a5db0e_remove_description_from_starter_messages.py b/backend/alembic/versions/b72ed7a5db0e_remove_description_from_starter_messages.py index 26fe266e5eb..96dfa964eac 100644 --- a/backend/alembic/versions/b72ed7a5db0e_remove_description_from_starter_messages.py +++ b/backend/alembic/versions/b72ed7a5db0e_remove_description_from_starter_messages.py @@ -26,7 +26,8 @@ def upgrade() -> None: FROM jsonb_array_elements(starter_messages) elem ) WHERE starter_messages IS NOT NULL - """ + AND jsonb_typeof(starter_messages) = 'array' + """ ) ) @@ -41,6 +42,7 @@ def downgrade() -> None: FROM jsonb_array_elements(starter_messages) elem ) WHERE starter_messages IS NOT NULL - """ + AND jsonb_typeof(starter_messages) = 'array' + """ ) )