Skip to content

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

Drop data field from checkout line model (#6961)

Filip Owczarekf6a2d35fd8ae
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0f8ec094f9..e722dd1ac6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Fix Sentry reporting - #6902 by @fowczarek
- Fix removing page types in cleardb command - #6918 by @fowczarek
- Fix argument validation in page resolver - #6960 by @fowczarek
+- Drop `data` field from checkout line model - #6961 by @fowczarek
### Breaking
- Multichannel MVP: Multicurrency - #6242 by @fowczarek @d-wysocki
diff --git a/saleor/checkout/migrations/0031_auto_20210303_1045.py b/saleor/checkout/migrations/0031_auto_20210303_1045.py
new file mode 100644
index 0000000000..3d4dc088ed
--- /dev/null
+++ b/saleor/checkout/migrations/0031_auto_20210303_1045.py
@@ -0,0 +1,21 @@
+# Generated by Django 3.1.7 on 2021-03-03 13:04
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("checkout", "0030_checkout_channel_listing"),
+ ]
+
+ operations = [
+ migrations.AlterUniqueTogether(
+ name="checkoutline",
+ unique_together=set(),
+ ),
+ migrations.RemoveField(
+ model_name="checkoutline",
+ name="data",
+ ),
+ ]
diff --git a/saleor/checkout/models.py b/saleor/checkout/models.py
index 2a491d0760..f056c57ee5 100644
--- a/saleor/checkout/models.py
+++ b/saleor/checkout/models.py
@@ -6,7 +6,6 @@ from uuid import uuid4
from django.conf import settings
from django.core.validators import MinValueValidator
from django.db import models
-from django.db.models import JSONField # type: ignore
from django.utils.encoding import smart_str
from django_countries.fields import Country, CountryField
from django_prices.models import MoneyField
@@ -177,10 +176,8 @@ class CheckoutLine(models.Model):
"product.ProductVariant", related_name="+", on_delete=models.CASCADE
)
quantity = models.PositiveIntegerField(validators=[MinValueValidator(1)])
- data = JSONField(blank=True, default=dict)
class Meta:
- unique_together = ("checkout", "variant", "data")
ordering = ("id",)
def __str__(self):