authentik.enterprise.reports.migrations.0001_initial

 1# Generated by Django 5.2.8 on 2025-12-02 17:19
 2
 3import authentik.admin.files.fields
 4import django.db.models.deletion
 5import uuid
 6from django.conf import settings
 7from django.db import migrations, models
 8
 9
10class Migration(migrations.Migration):
11
12    initial = True
13
14    dependencies = [
15        ("contenttypes", "0002_remove_content_type_name"),
16        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
17    ]
18
19    operations = [
20        migrations.CreateModel(
21            name="DataExport",
22            fields=[
23                ("id", models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
24                ("requested_on", models.DateTimeField(auto_now_add=True)),
25                ("query_params", models.JSONField()),
26                ("file", authentik.admin.files.fields.FileField(blank=True)),
27                ("completed", models.BooleanField(default=False)),
28                (
29                    "content_type",
30                    models.ForeignKey(
31                        on_delete=django.db.models.deletion.CASCADE, to="contenttypes.contenttype"
32                    ),
33                ),
34                (
35                    "requested_by",
36                    models.ForeignKey(
37                        null=True,
38                        on_delete=django.db.models.deletion.SET_NULL,
39                        to=settings.AUTH_USER_MODEL,
40                    ),
41                ),
42            ],
43            options={
44                "verbose_name": "Data Export",
45                "verbose_name_plural": "Data Exports",
46            },
47        ),
48    ]
class Migration(django.db.migrations.migration.Migration):
11class Migration(migrations.Migration):
12
13    initial = True
14
15    dependencies = [
16        ("contenttypes", "0002_remove_content_type_name"),
17        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
18    ]
19
20    operations = [
21        migrations.CreateModel(
22            name="DataExport",
23            fields=[
24                ("id", models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
25                ("requested_on", models.DateTimeField(auto_now_add=True)),
26                ("query_params", models.JSONField()),
27                ("file", authentik.admin.files.fields.FileField(blank=True)),
28                ("completed", models.BooleanField(default=False)),
29                (
30                    "content_type",
31                    models.ForeignKey(
32                        on_delete=django.db.models.deletion.CASCADE, to="contenttypes.contenttype"
33                    ),
34                ),
35                (
36                    "requested_by",
37                    models.ForeignKey(
38                        null=True,
39                        on_delete=django.db.models.deletion.SET_NULL,
40                        to=settings.AUTH_USER_MODEL,
41                    ),
42                ),
43            ],
44            options={
45                "verbose_name": "Data Export",
46                "verbose_name_plural": "Data Exports",
47            },
48        ),
49    ]

The base class for all migrations.

Migration files will import this from django.db.migrations.Migration and subclass it as a class called Migration. It will have one or more of the following attributes:

  • operations: A list of Operation instances, probably from django.db.migrations.operations
  • dependencies: A list of tuples of (app_path, migration_name)
  • run_before: A list of tuples of (app_path, migration_name)
  • replaces: A list of migration_names

Note that all migrations come out of migrations and into the Loader or Graph as instances, having been initialized with their app label and name.

initial = True
dependencies = [('contenttypes', '0002_remove_content_type_name'), ('authentik_core', '__first__')]
operations = [<CreateModel name='DataExport', fields=[('id', <django.db.models.fields.UUIDField>), ('requested_on', <django.db.models.fields.DateTimeField>), ('query_params', <django.db.models.fields.json.JSONField>), ('file', <authentik.admin.files.fields.FileField>), ('completed', <django.db.models.fields.BooleanField>), ('content_type', <django.db.models.fields.related.ForeignKey>), ('requested_by', <django.db.models.fields.related.ForeignKey>)], options={'verbose_name': 'Data Export', 'verbose_name_plural': 'Data Exports'}>]