From ca27576fc8e61416ada92815bbb956f0ea087d86 Mon Sep 17 00:00:00 2001 From: Adibov Date: Fri, 24 Nov 2023 01:12:48 +0330 Subject: [PATCH] refactor: change payment id type to UUID --- .../migrations/0047_remove_payment_is_done_payment_status.py | 5 +++++ backend/backend_api/models.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/backend_api/migrations/0047_remove_payment_is_done_payment_status.py b/backend/backend_api/migrations/0047_remove_payment_is_done_payment_status.py index 1f00bbe..996554f 100644 --- a/backend/backend_api/migrations/0047_remove_payment_is_done_payment_status.py +++ b/backend/backend_api/migrations/0047_remove_payment_is_done_payment_status.py @@ -19,4 +19,9 @@ class Migration(migrations.Migration): name='status', field=models.IntegerField(choices=[(0, 'Awaiting payment'), (1, 'Payment confirmed'), (2, 'Payment rejected')], default=0), ), + migrations.AlterField( + model_name='payment', + name='id', + field=models.UUIDField(primary_key=True, serialize=False), + ), ] diff --git a/backend/backend_api/models.py b/backend/backend_api/models.py index cc92ba8..8519973 100644 --- a/backend/backend_api/models.py +++ b/backend/backend_api/models.py @@ -294,7 +294,7 @@ class PaymentStatus(models.IntegerChoices): PAYMENT_CONFIRMED = 1, _('Payment confirmed') PAYMENT_REJECTED = 2, _('Payment rejected') - id = models.BigAutoField(primary_key=True) + id = models.UUIDField(primary_key=True) amount = models.PositiveIntegerField() user = models.ForeignKey(User, on_delete=models.CASCADE) workshops = models.ManyToManyField(Workshop, blank=True)