From 3c78968fa84582622941fa7b83c52bd3944638f4 Mon Sep 17 00:00:00 2001 From: Lukas Joss Date: Tue, 29 Oct 2024 14:30:25 +0100 Subject: [PATCH] PB-987: Add migration reverse --- .../migrations/0053_update_conformance_endpoint.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/stac_api/migrations/0053_update_conformance_endpoint.py b/app/stac_api/migrations/0053_update_conformance_endpoint.py index 1307558d..87b3ca2e 100644 --- a/app/stac_api/migrations/0053_update_conformance_endpoint.py +++ b/app/stac_api/migrations/0053_update_conformance_endpoint.py @@ -10,9 +10,17 @@ def add_landing_page_version(apps, schema_editor): lp.save() +def reverse_landing_page_version(apps, schema_editor): + # Remove the landing page v0.9 + LandingPage = apps.get_model("stac_api", "LandingPage") + lp = LandingPage.objects.get(version='v1') + lp.conformsTo.remove('https://api.stacspec.org/v1.0.0/ogcapi-features') + lp.save() + + class Migration(migrations.Migration): dependencies = [ ("stac_api", "0052_asset_add_del_asset_item_file_size_trigger_and_more"), ] - operations = [migrations.RunPython(add_landing_page_version)] + operations = [migrations.RunPython(add_landing_page_version, reverse_landing_page_version)]