Skip to content

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

Increase size of Payment and Transaction tokens (#6411) (#6424)

Marcin Gębalaa82166ce550e
diff --git a/saleor/payment/migrations/0022_auto_20201104_1458.py b/saleor/payment/migrations/0022_auto_20201104_1458.py
new file mode 100644
index 0000000000..c6a293c422
--- /dev/null
+++ b/saleor/payment/migrations/0022_auto_20201104_1458.py
@@ -0,0 +1,28 @@
+# Generated by Django 3.1.2 on 2020-11-04 14:58
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("payment", "0021_transaction_searchable_key"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="payment",
+ name="token",
+ field=models.CharField(blank=True, default="", max_length=512),
+ ),
+ migrations.AlterField(
+ model_name="transaction",
+ name="searchable_key",
+ field=models.CharField(blank=True, max_length=512, null=True),
+ ),
+ migrations.AlterField(
+ model_name="transaction",
+ name="token",
+ field=models.CharField(blank=True, default="", max_length=512),
+ ),
+ ]
diff --git a/saleor/payment/models.py b/saleor/payment/models.py
index ae0fc73ed9..d76a39aafd 100644
--- a/saleor/payment/models.py
+++ b/saleor/payment/models.py
@@ -37,7 +37,7 @@ class Payment(models.Model):
charge_status = models.CharField(
max_length=20, choices=ChargeStatus.CHOICES, default=ChargeStatus.NOT_CHARGED
)
- token = models.CharField(max_length=128, blank=True, default="")
+ token = models.CharField(max_length=512, blank=True, default="")
total = models.DecimalField(
max_digits=settings.DEFAULT_MAX_DIGITS,
decimal_places=settings.DEFAULT_DECIMAL_PLACES,
@@ -198,7 +198,7 @@ class Transaction(models.Model):
payment = models.ForeignKey(
Payment, related_name="transactions", on_delete=models.PROTECT
)
- token = models.CharField(max_length=128, blank=True, default="")
+ token = models.CharField(max_length=512, blank=True, default="")
kind = models.CharField(max_length=25, choices=TransactionKind.CHOICES)
is_success = models.BooleanField(default=False)
action_required = models.BooleanField(default=False)
@@ -219,7 +219,7 @@ class Transaction(models.Model):
customer_id = models.CharField(max_length=256, null=True)
gateway_response = JSONField(encoder=DjangoJSONEncoder)
already_processed = models.BooleanField(default=False)
- searchable_key = models.CharField(max_length=256, null=True, blank=True)
+ searchable_key = models.CharField(max_length=512, null=True, blank=True)
class Meta:
ordering = ("pk",)