feat: ✨ uuid token
This commit is contained in:
parent
a73553ab81
commit
b90fa4ae3c
30 changed files with 223 additions and 142 deletions
39
user_token/migrations/0001_initial.py
Normal file
39
user_token/migrations/0001_initial.py
Normal file
|
@ -0,0 +1,39 @@
|
|||
# Generated by Django 5.0.6 on 2024-07-03 01:46
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
("user", "0001_initial"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="UserToken",
|
||||
fields=[
|
||||
(
|
||||
"token",
|
||||
models.CharField(
|
||||
auto_created=True,
|
||||
max_length=16,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
unique=True,
|
||||
),
|
||||
),
|
||||
(
|
||||
"user",
|
||||
models.ForeignKey(
|
||||
auto_created=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="tokens",
|
||||
to="user.user",
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
]
|
|
@ -0,0 +1,36 @@
|
|||
# Generated by Django 5.0.6 on 2024-07-03 02:25
|
||||
|
||||
import django.db.models.deletion
|
||||
import uuid
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("user", "0001_initial"),
|
||||
("user_token", "0001_initial"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="usertoken",
|
||||
name="token",
|
||||
field=models.CharField(
|
||||
auto_created=True,
|
||||
default=uuid.UUID("f609e128-79ad-4fbd-b384-9bb5e9c0b631"),
|
||||
max_length=36,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
unique=True,
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="usertoken",
|
||||
name="user",
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="tokens",
|
||||
to="user.user",
|
||||
),
|
||||
),
|
||||
]
|
0
user_token/migrations/__init__.py
Normal file
0
user_token/migrations/__init__.py
Normal file
Loading…
Add table
Add a link
Reference in a new issue