Coverage for distro_tracker/signon/migrations/0001_initial.py: 100%
7 statements
« prev ^ index » next coverage.py v6.5.0, created at 2025-01-12 09:15 +0000
« prev ^ index » next coverage.py v6.5.0, created at 2025-01-12 09:15 +0000
1# Generated by Django 4.2.17 on 2025-01-03 17:25
3from django.conf import settings
4from django.db import migrations, models
5import django.db.models.deletion
8class Migration(migrations.Migration):
10 initial = True
12 dependencies = [
13 migrations.swappable_dependency(settings.AUTH_USER_MODEL),
14 ]
16 operations = [
17 migrations.CreateModel(
18 name='Identity',
19 fields=[
20 ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
21 ('issuer', models.CharField(help_text='identifier of auhoritative system for this identity', max_length=512)),
22 ('subject', models.CharField(help_text='identifier of the user in the issuer system', max_length=512)),
23 ('last_used', models.DateTimeField(auto_now=True, help_text='last time this identity has been used')),
24 ('claims', models.JSONField(default=dict)),
25 ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='identities', to=settings.AUTH_USER_MODEL)),
26 ],
27 ),
28 migrations.AddConstraint(
29 model_name='identity',
30 constraint=models.UniqueConstraint(fields=('issuer', 'subject'), name='signon_identity_unique_issuer_subject'),
31 ),
32 ]