feat: update UUID generation to use uuid.uuid7 and add uuid-utils dependency
This commit is contained in:
parent
04642eb497
commit
342f984a3b
@ -1,6 +1,6 @@
|
|||||||
# Generated by Django 5.2 on 2025-04-14 02:22
|
# Generated by Django 5.2 on 2025-04-14 02:22
|
||||||
|
|
||||||
import uuid
|
import uuid_utils.compat
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
from common.constants.permission_constants import RoleConstants
|
from common.constants.permission_constants import RoleConstants
|
||||||
@ -26,7 +26,7 @@ class Migration(migrations.Migration):
|
|||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='User',
|
name='User',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.UUIDField(default=uuid.uuid1, editable=False, primary_key=True, serialize=False,
|
('id', models.UUIDField(default=uuid_utils.compat.uuid7, editable=False, primary_key=True, serialize=False,
|
||||||
verbose_name='主键id')),
|
verbose_name='主键id')),
|
||||||
('email', models.EmailField(blank=True, max_length=254, null=True, unique=True, verbose_name='邮箱')),
|
('email', models.EmailField(blank=True, max_length=254, null=True, unique=True, verbose_name='邮箱')),
|
||||||
('phone', models.CharField(default='', max_length=20, verbose_name='电话')),
|
('phone', models.CharField(default='', max_length=20, verbose_name='电话')),
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
@date:2025/4/14 10:20
|
@date:2025/4/14 10:20
|
||||||
@desc:
|
@desc:
|
||||||
"""
|
"""
|
||||||
import uuid
|
import uuid_utils.compat as uuid
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ from common.utils.common import password_encrypt
|
|||||||
|
|
||||||
|
|
||||||
class User(models.Model):
|
class User(models.Model):
|
||||||
id = models.UUIDField(primary_key=True, max_length=128, default=uuid.uuid1, editable=False, verbose_name="主键id")
|
id = models.UUIDField(primary_key=True, max_length=128, default=uuid.uuid7, editable=False, verbose_name="主键id")
|
||||||
email = models.EmailField(unique=True, null=True, blank=True, verbose_name="邮箱")
|
email = models.EmailField(unique=True, null=True, blank=True, verbose_name="邮箱")
|
||||||
phone = models.CharField(max_length=20, verbose_name="电话", default="")
|
phone = models.CharField(max_length=20, verbose_name="电话", default="")
|
||||||
nick_name = models.CharField(max_length=150, verbose_name="昵称", default="")
|
nick_name = models.CharField(max_length=150, verbose_name="昵称", default="")
|
||||||
|
|||||||
@ -13,6 +13,7 @@ django-redis = "5.4.0"
|
|||||||
django-db-connection-pool = "1.2.5"
|
django-db-connection-pool = "1.2.5"
|
||||||
psycopg = {extras = ["binary"], version = "3.2.6"}
|
psycopg = {extras = ["binary"], version = "3.2.6"}
|
||||||
python-dotenv = "1.1.0"
|
python-dotenv = "1.1.0"
|
||||||
|
uuid-utils = "0.10.0"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core"]
|
requires = ["poetry-core"]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user