This repository was archived by the owner on Aug 29, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 120
Expand file tree
/
Copy path0001_initial.py
More file actions
54 lines (48 loc) · 1.88 KB
/
Copy path0001_initial.py
File metadata and controls
54 lines (48 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Generated by Django 5.2.8 on 2025-11-18 01:11
import django.core.validators
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
migrations.swappable_dependency(settings.KNOX_TOKEN_MODEL),
]
operations = [
migrations.CreateModel(
name='AccessToken',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
(
'name',
models.CharField(
max_length=64,
validators=[django.core.validators.MinLengthValidator(3)],
verbose_name='Token Name',
),
),
('last_used', models.DateTimeField(blank=True, null=True)),
('modified_at', models.DateTimeField(auto_now=True)),
(
'knox_token',
models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE, related_name='meta', to=settings.KNOX_TOKEN_MODEL
),
),
(
'user',
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name='access_tokens',
to=settings.AUTH_USER_MODEL,
),
),
],
options={
'verbose_name': 'Access Token',
'verbose_name_plural': 'Access Tokens',
'constraints': [models.UniqueConstraint(fields=('user', 'name'), name='unique_token_name_per_user')],
},
),
]