From dc9effdd5b70c175f183e0dd382678069b96e1b1 Mon Sep 17 00:00:00 2001 From: Egor fureunoir Gorbunov Date: Tue, 6 May 2025 17:04:29 +0300 Subject: [PATCH] Update `human_readable_id` field in `Order` model Alter the `human_readable_id` field to use a custom generator function and ensure uniqueness. This improves the readability and integrity of order identifiers. --- .../0019_alter_order_human_readable_id.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 core/migrations/0019_alter_order_human_readable_id.py diff --git a/core/migrations/0019_alter_order_human_readable_id.py b/core/migrations/0019_alter_order_human_readable_id.py new file mode 100644 index 00000000..e9f8c60d --- /dev/null +++ b/core/migrations/0019_alter_order_human_readable_id.py @@ -0,0 +1,19 @@ +# Generated by Django 5.1.8 on 2025-05-06 14:01 + +import core.utils +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0018_alter_order_human_readable_id'), + ] + + operations = [ + migrations.AlterField( + model_name='order', + name='human_readable_id', + field=models.CharField(default=core.utils.generate_human_readable_id, help_text='a human-readable identifier for the order', max_length=8, unique=True, verbose_name='human readable id'), + ), + ]