Skip to content

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

Revert "Finish JSONField cart migration"

Krzysztof Wolski9ce5c290fb69
diff --git a/saleor/cart/migrations/0007_auto_20161209_0753.py b/saleor/cart/migrations/0007_auto_20161209_0753.py
deleted file mode 100644
index 67bb87985e..0000000000
--- a/saleor/cart/migrations/0007_auto_20161209_0753.py
+++ /dev/null
@@ -1,29 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.3 on 2016-12-09 13:53
-from __future__ import unicode_literals
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('cart', '0006_auto_20161209_0750'),
- ]
-
- operations = [
- migrations.RenameField(
- model_name='cart',
- old_name='checkout_data_postgres',
- new_name='checkout_data',
- ),
- migrations.RenameField(
- model_name='cartline',
- old_name='data_postgres',
- new_name='data',
- ),
- migrations.AlterUniqueTogether(
- name='cartline',
- unique_together=set([('cart', 'variant', 'data')]),
- ),
- ]
diff --git a/saleor/cart/models.py b/saleor/cart/models.py
index c21da36935..cec916e6c0 100644
--- a/saleor/cart/models.py
+++ b/saleor/cart/models.py
@@ -100,7 +100,7 @@ class Cart(models.Model):
primary_key=True, default=uuid4, editable=False)
voucher = models.ForeignKey(
Voucher, null=True, related_name='+', on_delete=models.SET_NULL)
- checkout_data = JSONField(null=True, editable=False)
+ checkout_data_postgres = JSONField(null=True, editable=False)
total = PriceField(
currency=settings.DEFAULT_CURRENCY, max_digits=12, decimal_places=2,
@@ -228,10 +228,10 @@ class CartLine(models.Model, ItemLine):
quantity = models.PositiveIntegerField(
pgettext_lazy('Cart line', 'quantity'),
validators=[MinValueValidator(0), MaxValueValidator(999)])
- data = JSONField(blank=True, default={})
+ data_postgres = JSONField(blank=True, default={})
class Meta:
- unique_together = ('cart', 'variant', 'data')
+ unique_together = ('cart', 'variant', 'data_postgres')
def __str__(self):
return smart_str(self.variant)