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.
This commit is contained in:
parent
4deece673f
commit
dc9effdd5b
1 changed files with 19 additions and 0 deletions
19
core/migrations/0019_alter_order_human_readable_id.py
Normal file
19
core/migrations/0019_alter_order_human_readable_id.py
Normal file
|
|
@ -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'),
|
||||
),
|
||||
]
|
||||
Loading…
Reference in a new issue