Skip to content

Commit

Permalink
PB-987: Add migration reverse
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasJoss committed Oct 29, 2024
1 parent 0348d7d commit 3c78968
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/stac_api/migrations/0053_update_conformance_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]

0 comments on commit 3c78968

Please sign in to comment.