From 8185c92e9d433f8de730135d4438149276129af9 Mon Sep 17 00:00:00 2001 From: Conor Brady Date: Mon, 25 Nov 2024 13:35:33 -0800 Subject: [PATCH] Add IF EXISTs clause for partitioned and mat view tables (#4133) So that dev deployments that aren't partitioned can run --- .../versions/4014ddf1f874_partition_weather_station_model_.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/alembic/versions/4014ddf1f874_partition_weather_station_model_.py b/api/alembic/versions/4014ddf1f874_partition_weather_station_model_.py index 14508606f..0cee3c25b 100644 --- a/api/alembic/versions/4014ddf1f874_partition_weather_station_model_.py +++ b/api/alembic/versions/4014ddf1f874_partition_weather_station_model_.py @@ -17,8 +17,8 @@ def upgrade(): # ### drop table that's now partitioned ### - op.execute("DROP MATERIALIZED VIEW morecast_2_materialized_view") - op.drop_table("weather_station_model_predictions_retired") + op.execute("DROP MATERIALIZED VIEW IF EXISTS morecast_2_materialized_view") + op.drop_table("weather_station_model_predictions_retired", if_exists=True) def downgrade():