Skip to content

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

Adjust migrations

Pacu2894c0c65265d
diff --git a/saleor/payment/migrations/0001_initial.py b/saleor/payment/migrations/0001_initial.py
index 70f3966f61..d2d6c035ca 100644
--- a/saleor/payment/migrations/0001_initial.py
+++ b/saleor/payment/migrations/0001_initial.py
@@ -48,7 +48,6 @@ class Migration(migrations.Migration):
('cc_last_digits', models.CharField(blank=True, default='', max_length=4)),
('extra_data', models.TextField(blank=True, default='')),
('token', models.CharField(blank=True, default='', max_length=128)),
- ('error', models.CharField(choices=[(saleor.payment.TransactionError('incorrect_number'), 'incorrect_number'), (saleor.payment.TransactionError('invalid_number'), 'invalid_number'), (saleor.payment.TransactionError('incorrect_cvv'), 'incorrect_cvv'), (saleor.payment.TransactionError('invalid_cvv'), 'invalid_cvv'), (saleor.payment.TransactionError('incorrect_zip'), 'incorrect_zip'), (saleor.payment.TransactionError('incorrect_address'), 'incorrect_address'), (saleor.payment.TransactionError('invalid_expiry_date'), 'invalid_expiry_date'), (saleor.payment.TransactionError('expired'), 'expired'), (saleor.payment.TransactionError('processing_error'), 'processing_error'), (saleor.payment.TransactionError('declined'), 'declined')], max_length=256, null=True)),
('currency', models.CharField(max_length=10)),
('total', models.DecimalField(decimal_places=2, default=Decimal('0.0'), max_digits=12)),
('captured_amount', models.DecimalField(decimal_places=2, default=Decimal('0.0'), max_digits=12)),
@@ -64,6 +63,7 @@ class Migration(migrations.Migration):
('token', models.CharField(blank=True, default='', max_length=128)),
('kind', models.CharField(choices=[('auth', 'Authorization'), ('charge', 'Charge'), ('refund', 'Refund'), ('capture', 'Capture'), ('void', 'Void')], max_length=10)),
('is_success', models.BooleanField(default=False)),
+ ('error', models.CharField(choices=[(saleor.payment.TransactionError('incorrect_number'), 'incorrect_number'), (saleor.payment.TransactionError('invalid_number'), 'invalid_number'), (saleor.payment.TransactionError('incorrect_cvv'), 'incorrect_cvv'), (saleor.payment.TransactionError('invalid_cvv'), 'invalid_cvv'), (saleor.payment.TransactionError('incorrect_zip'), 'incorrect_zip'), (saleor.payment.TransactionError('incorrect_address'), 'incorrect_address'), (saleor.payment.TransactionError('invalid_expiry_date'), 'invalid_expiry_date'), (saleor.payment.TransactionError('expired'), 'expired'), (saleor.payment.TransactionError('processing_error'), 'processing_error'), (saleor.payment.TransactionError('declined'), 'declined')], max_length=256, null=True)),
('currency', models.CharField(max_length=10)),
('amount', models.DecimalField(decimal_places=2, default=Decimal('0.0'), max_digits=12)),
('gateway_response', django.contrib.postgres.fields.jsonb.JSONField()),
diff --git a/saleor/payment/models.py b/saleor/payment/models.py
index 351ed813e8..d72f2c2d39 100644
--- a/saleor/payment/models.py
+++ b/saleor/payment/models.py
@@ -52,7 +52,7 @@ class Payment(models.Model):
billing_email = models.EmailField(blank=True)
customer_ip_address = models.GenericIPAddressField(blank=True, null=True)
extra_data = models.TextField(blank=True, default='')
- token = models.CharField(max_length=36, blank=True, default='')
+ token = models.CharField(max_length=128, blank=True, default='')
#: Currency code (might be gateway-specific)
# FIXME: add ISO4217 validator?
@@ -149,7 +149,7 @@ class Transaction(models.Model):
created = models.DateTimeField(auto_now_add=True, editable=False)
payment = models.ForeignKey(
Payment, related_name='transactions', on_delete=models.PROTECT)
- token = models.CharField(max_length=64, blank=True, default='')
+ token = models.CharField(max_length=128, blank=True, default='')
kind = models.CharField(max_length=10, choices=TransactionKind.CHOICES)
# FIXME probably we should have error/pending/success status instead of
# a bool, eg for payments with 3d secure