Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix removing page types in cleardb command

fowczrek4ec474c02781
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8e847e1dd3..68b5f61716 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Add CUSTOMER_UPDATED webhook, add addresses field to customer CUSTOMER_CREATED webhook - #6898 by @piotrgrundas
- Add missing span in PluginManager - #6900 by @fowczarek
- Fix Sentry reporting - #6902 by @fowczarek
+- Fix removing page types in cleardb command - #6918 by @fowczarek
### Breaking
- Multichannel MVP: Multicurrency - #6242 by @fowczarek @d-wysocki
diff --git a/saleor/core/management/commands/cleardb.py b/saleor/core/management/commands/cleardb.py
index f9dd377d1f..2e49e61198 100644
--- a/saleor/core/management/commands/cleardb.py
+++ b/saleor/core/management/commands/cleardb.py
@@ -15,7 +15,7 @@ from ....checkout.models import Checkout
from ....discount.models import Sale, Voucher
from ....giftcard.models import GiftCard
from ....order.models import Order
-from ....page.models import Page
+from ....page.models import Page, PageType
from ....payment.models import Payment, Transaction
from ....product.models import Category, Collection, Product, ProductType
from ....shipping.models import ShippingMethod, ShippingZone
@@ -91,6 +91,9 @@ class Command(BaseCommand):
Page.objects.all().delete()
self.stdout.write("Removed pages")
+ PageType.objects.all().delete()
+ self.stdout.write("Removed page types")
+
Webhook.objects.all().delete()
self.stdout.write("Removed webhooks")