Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Finish JSONField cart migration
Krzysztof Wolski6d93efc8cd68
diff --git a/saleor/cart/migrations/0007_auto_20161209_0753.py b/saleor/cart/migrations/0007_auto_20161209_0753.pynew file mode 100644index 0000000000..0ce11167aa--- /dev/null+++ b/saleor/cart/migrations/0007_auto_20161209_0753.py@@ -0,0 +1,30 @@+# -*- 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 = [+ ('product', '0014_auto_20161209_0546'),+ ('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.pyindex 0cb5e43e06..ec4c368127 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_postgres = JSONField(null=True, editable=False)+ checkout_data = 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_postgres = JSONField(blank=True, default={})+ data = JSONField(blank=True, default={})class Meta:- unique_together = ('cart', 'variant', 'data_postgres')+ unique_together = ('cart', 'variant', 'data')def __str__(self):return smart_str(self.variant)