From e8b0a80f5fc4f8fe517d48c71b5a9ed6c9a7c23a Mon Sep 17 00:00:00 2001 From: James Biggs <62654785+jamesbiggs@users.noreply.github.com> Date: Tue, 22 Oct 2024 11:22:04 +0100 Subject: [PATCH] Remove UUID field from pages (#1733) --- ...e_uuid_remove_articlepage_uuid_and_more.py | 30 +++++++++++++++ ...page_uuid_remove_blogpage_uuid_and_more.py | 26 +++++++++++++ ..._remove_explorerindexpage_uuid_and_more.py | 38 +++++++++++++++++++ ..._remove_cookiedetailspage_uuid_and_more.py | 22 +++++++++++ etna/core/models/basepage.py | 3 -- ...ve_generalpage_uuid_remove_hubpage_uuid.py | 22 +++++++++++ .../migrations/0030_remove_homepage_uuid.py | 18 +++++++++ ...leindexpage_uuid_remove_personpage_uuid.py | 22 +++++++++++ ...uid_remove_exhibitionpage_uuid_and_more.py | 26 +++++++++++++ 9 files changed, 204 insertions(+), 3 deletions(-) create mode 100644 etna/articles/migrations/0111_remove_articleindexpage_uuid_remove_articlepage_uuid_and_more.py create mode 100644 etna/blog/migrations/0004_remove_blogindexpage_uuid_remove_blogpage_uuid_and_more.py create mode 100644 etna/collections/migrations/0060_remove_explorerindexpage_uuid_and_more.py create mode 100644 etna/cookies/migrations/0002_remove_cookiedetailspage_uuid_and_more.py create mode 100644 etna/generic_pages/migrations/0038_remove_generalpage_uuid_remove_hubpage_uuid.py create mode 100644 etna/home/migrations/0030_remove_homepage_uuid.py create mode 100644 etna/people/migrations/0013_remove_peopleindexpage_uuid_remove_personpage_uuid.py create mode 100644 etna/whatson/migrations/0013_remove_eventpage_uuid_remove_exhibitionpage_uuid_and_more.py diff --git a/etna/articles/migrations/0111_remove_articleindexpage_uuid_remove_articlepage_uuid_and_more.py b/etna/articles/migrations/0111_remove_articleindexpage_uuid_remove_articlepage_uuid_and_more.py new file mode 100644 index 000000000..26167a184 --- /dev/null +++ b/etna/articles/migrations/0111_remove_articleindexpage_uuid_remove_articlepage_uuid_and_more.py @@ -0,0 +1,30 @@ +# Generated by Django 5.0.8 on 2024-10-22 10:10 +# etna:allowRemoveField + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("articles", "0110_alter_articlepage_body_alter_focusedarticlepage_body"), + ] + + operations = [ + migrations.RemoveField( + model_name="articleindexpage", + name="uuid", + ), + migrations.RemoveField( + model_name="articlepage", + name="uuid", + ), + migrations.RemoveField( + model_name="focusedarticlepage", + name="uuid", + ), + migrations.RemoveField( + model_name="recordarticlepage", + name="uuid", + ), + ] diff --git a/etna/blog/migrations/0004_remove_blogindexpage_uuid_remove_blogpage_uuid_and_more.py b/etna/blog/migrations/0004_remove_blogindexpage_uuid_remove_blogpage_uuid_and_more.py new file mode 100644 index 000000000..4425c33d0 --- /dev/null +++ b/etna/blog/migrations/0004_remove_blogindexpage_uuid_remove_blogpage_uuid_and_more.py @@ -0,0 +1,26 @@ +# Generated by Django 5.0.8 on 2024-10-22 10:10 +# etna:allowRemoveField + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("blog", "0003_blogpostpage_hero_image_and_more"), + ] + + operations = [ + migrations.RemoveField( + model_name="blogindexpage", + name="uuid", + ), + migrations.RemoveField( + model_name="blogpage", + name="uuid", + ), + migrations.RemoveField( + model_name="blogpostpage", + name="uuid", + ), + ] diff --git a/etna/collections/migrations/0060_remove_explorerindexpage_uuid_and_more.py b/etna/collections/migrations/0060_remove_explorerindexpage_uuid_and_more.py new file mode 100644 index 000000000..c524bc15e --- /dev/null +++ b/etna/collections/migrations/0060_remove_explorerindexpage_uuid_and_more.py @@ -0,0 +1,38 @@ +# Generated by Django 5.0.8 on 2024-10-22 10:10 +# etna:allowRemoveField + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("collections", "0059_explorerindexpage_twitter_og_description_and_more"), + ] + + operations = [ + migrations.RemoveField( + model_name="explorerindexpage", + name="uuid", + ), + migrations.RemoveField( + model_name="highlightgallerypage", + name="uuid", + ), + migrations.RemoveField( + model_name="timeperiodexplorerindexpage", + name="uuid", + ), + migrations.RemoveField( + model_name="timeperiodexplorerpage", + name="uuid", + ), + migrations.RemoveField( + model_name="topicexplorerindexpage", + name="uuid", + ), + migrations.RemoveField( + model_name="topicexplorerpage", + name="uuid", + ), + ] diff --git a/etna/cookies/migrations/0002_remove_cookiedetailspage_uuid_and_more.py b/etna/cookies/migrations/0002_remove_cookiedetailspage_uuid_and_more.py new file mode 100644 index 000000000..4dbe3dc7b --- /dev/null +++ b/etna/cookies/migrations/0002_remove_cookiedetailspage_uuid_and_more.py @@ -0,0 +1,22 @@ +# Generated by Django 5.0.8 on 2024-10-22 10:10 +# etna:allowRemoveField + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("cookies", "0001_initial"), + ] + + operations = [ + migrations.RemoveField( + model_name="cookiedetailspage", + name="uuid", + ), + migrations.RemoveField( + model_name="cookiespage", + name="uuid", + ), + ] diff --git a/etna/core/models/basepage.py b/etna/core/models/basepage.py index 384064e28..e992acb84 100644 --- a/etna/core/models/basepage.py +++ b/etna/core/models/basepage.py @@ -1,5 +1,4 @@ from typing import Any, Dict -from uuid import uuid4 from django.conf import settings from django.db import models @@ -70,8 +69,6 @@ class BasePage(AlertMixin, SocialMixin, DataLayerMixin, HeadlessPreviewMixin, Pa help_text=_("Image that will appear on thumbnails and promos around the site."), ) - uuid = models.UUIDField("UUID", unique=True, default=uuid4, editable=False) - # DataLayerMixin overrides gtm_content_group = "Page" diff --git a/etna/generic_pages/migrations/0038_remove_generalpage_uuid_remove_hubpage_uuid.py b/etna/generic_pages/migrations/0038_remove_generalpage_uuid_remove_hubpage_uuid.py new file mode 100644 index 000000000..9cf9f3c5a --- /dev/null +++ b/etna/generic_pages/migrations/0038_remove_generalpage_uuid_remove_hubpage_uuid.py @@ -0,0 +1,22 @@ +# Generated by Django 5.0.8 on 2024-10-22 10:10 +# etna:allowRemoveField + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("generic_pages", "0037_alter_generalpage_body"), + ] + + operations = [ + migrations.RemoveField( + model_name="generalpage", + name="uuid", + ), + migrations.RemoveField( + model_name="hubpage", + name="uuid", + ), + ] diff --git a/etna/home/migrations/0030_remove_homepage_uuid.py b/etna/home/migrations/0030_remove_homepage_uuid.py new file mode 100644 index 000000000..381f89355 --- /dev/null +++ b/etna/home/migrations/0030_remove_homepage_uuid.py @@ -0,0 +1,18 @@ +# Generated by Django 5.0.8 on 2024-10-22 10:10 +# etna:allowRemoveField + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("home", "0029_homepage_twitter_og_description_and_more"), + ] + + operations = [ + migrations.RemoveField( + model_name="homepage", + name="uuid", + ), + ] diff --git a/etna/people/migrations/0013_remove_peopleindexpage_uuid_remove_personpage_uuid.py b/etna/people/migrations/0013_remove_peopleindexpage_uuid_remove_personpage_uuid.py new file mode 100644 index 000000000..fa2cb2cd8 --- /dev/null +++ b/etna/people/migrations/0013_remove_peopleindexpage_uuid_remove_personpage_uuid.py @@ -0,0 +1,22 @@ +# Generated by Django 5.0.8 on 2024-10-22 10:10 +# etna:allowRemoveField + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("people", "0012_shopitem"), + ] + + operations = [ + migrations.RemoveField( + model_name="peopleindexpage", + name="uuid", + ), + migrations.RemoveField( + model_name="personpage", + name="uuid", + ), + ] diff --git a/etna/whatson/migrations/0013_remove_eventpage_uuid_remove_exhibitionpage_uuid_and_more.py b/etna/whatson/migrations/0013_remove_eventpage_uuid_remove_exhibitionpage_uuid_and_more.py new file mode 100644 index 000000000..755ddd793 --- /dev/null +++ b/etna/whatson/migrations/0013_remove_eventpage_uuid_remove_exhibitionpage_uuid_and_more.py @@ -0,0 +1,26 @@ +# Generated by Django 5.0.8 on 2024-10-22 10:10 +# etna:allowRemoveField + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("whatson", "0012_eventpage_twitter_og_description_and_more"), + ] + + operations = [ + migrations.RemoveField( + model_name="eventpage", + name="uuid", + ), + migrations.RemoveField( + model_name="exhibitionpage", + name="uuid", + ), + migrations.RemoveField( + model_name="whatsonpage", + name="uuid", + ), + ]