Skip to content

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

Increase order line product_name max length

Anna Siwik3af7f5e27ee1
diff --git a/saleor/order/migrations/0046_order_line_name_length.py b/saleor/order/migrations/0046_order_line_name_length.py
new file mode 100644
index 0000000000..be70372fdc
--- /dev/null
+++ b/saleor/order/migrations/0046_order_line_name_length.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.0.3 on 2018-04-26 09:11
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('order', '0045_auto_20180329_0142'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='orderline',
+ name='product_name',
+ field=models.CharField(max_length=386),
+ ),
+ ]
diff --git a/saleor/order/models.py b/saleor/order/models.py
index ef7b575f62..1579c6ff08 100644
--- a/saleor/order/models.py
+++ b/saleor/order/models.py
@@ -182,7 +182,8 @@ class OrderLine(models.Model):
variant = models.ForeignKey(
ProductVariant, related_name='+', on_delete=models.SET_NULL,
blank=True, null=True)
- product_name = models.CharField(max_length=128)
+ # max_length is as produced by ProductVariant's display_product method
+ product_name = models.CharField(max_length=386)
product_sku = models.CharField(max_length=32)
is_shipping_required = models.BooleanField()
quantity = models.IntegerField(