gh_UserManager/apps/api/apps/authentication/migrations/0001_initial.py
bermooda-company 54d5891edf user
2026-08-23 23:59:14 +03:30

39 lines
1.8 KiB
Python

# Generated by Django 5.2.17 on 2026-08-15 08:17
import django.db.models.deletion
import uuid
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),
]
operations = [
migrations.CreateModel(
name='Credential',
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('credential_type', models.CharField(choices=[('password', 'Password'), ('phone', 'Phone'), ('email', 'Email'), ('passkey', 'Passkey'), ('oauth', 'OAuth Provider')], max_length=16)),
('provider', models.CharField(blank=True, default='', max_length=128)),
('value_hash', models.CharField(blank=True, default='', max_length=128)),
('is_active', models.BooleanField(default=True)),
('is_default', models.BooleanField(default=False)),
('last_used_at', models.DateTimeField(blank=True, null=True)),
('times_used', models.IntegerField(default=0)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='credentials', to=settings.AUTH_USER_MODEL)),
],
options={
'ordering': ['-is_default', '-created_at'],
'indexes': [models.Index(fields=['user', 'credential_type'], name='authenticat_user_id_fe6d82_idx'), models.Index(fields=['user', 'is_default'], name='authenticat_user_id_1df860_idx'), models.Index(fields=['is_active'], name='authenticat_is_acti_693057_idx')],
},
),
]