authentik.enterprise.stages.account_lockdown.migrations.0001_initial

 1# Generated by Django 5.2.13 on 2026-04-19 21:56
 2
 3import django.db.models.deletion
 4from django.db import migrations, models
 5
 6
 7class Migration(migrations.Migration):
 8
 9    initial = True
10
11    dependencies = [
12        ("authentik_flows", "0031_alter_flow_layout"),
13    ]
14
15    operations = [
16        migrations.CreateModel(
17            name="AccountLockdownStage",
18            fields=[
19                (
20                    "stage_ptr",
21                    models.OneToOneField(
22                        auto_created=True,
23                        on_delete=django.db.models.deletion.CASCADE,
24                        parent_link=True,
25                        primary_key=True,
26                        serialize=False,
27                        to="authentik_flows.stage",
28                    ),
29                ),
30                (
31                    "deactivate_user",
32                    models.BooleanField(
33                        default=True,
34                        help_text="Deactivate the user account (set is_active to False)",
35                    ),
36                ),
37                (
38                    "set_unusable_password",
39                    models.BooleanField(
40                        default=True, help_text="Set an unusable password for the user"
41                    ),
42                ),
43                (
44                    "delete_sessions",
45                    models.BooleanField(
46                        default=True, help_text="Delete all active sessions for the user"
47                    ),
48                ),
49                (
50                    "revoke_tokens",
51                    models.BooleanField(
52                        default=True,
53                        help_text="Revoke all tokens for the user (API, app password, recovery, verification, OAuth)",
54                    ),
55                ),
56                (
57                    "self_service_completion_flow",
58                    models.ForeignKey(
59                        blank=True,
60                        help_text="Flow to redirect users to after self-service lockdown. This flow should not require authentication since the user's session is deleted.",
61                        null=True,
62                        on_delete=django.db.models.deletion.SET_NULL,
63                        related_name="account_lockdown_stages",
64                        to="authentik_flows.flow",
65                    ),
66                ),
67            ],
68            options={
69                "verbose_name": "Account Lockdown Stage",
70                "verbose_name_plural": "Account Lockdown Stages",
71            },
72            bases=("authentik_flows.stage",),
73        ),
74    ]
class Migration(django.db.migrations.migration.Migration):
 8class Migration(migrations.Migration):
 9
10    initial = True
11
12    dependencies = [
13        ("authentik_flows", "0031_alter_flow_layout"),
14    ]
15
16    operations = [
17        migrations.CreateModel(
18            name="AccountLockdownStage",
19            fields=[
20                (
21                    "stage_ptr",
22                    models.OneToOneField(
23                        auto_created=True,
24                        on_delete=django.db.models.deletion.CASCADE,
25                        parent_link=True,
26                        primary_key=True,
27                        serialize=False,
28                        to="authentik_flows.stage",
29                    ),
30                ),
31                (
32                    "deactivate_user",
33                    models.BooleanField(
34                        default=True,
35                        help_text="Deactivate the user account (set is_active to False)",
36                    ),
37                ),
38                (
39                    "set_unusable_password",
40                    models.BooleanField(
41                        default=True, help_text="Set an unusable password for the user"
42                    ),
43                ),
44                (
45                    "delete_sessions",
46                    models.BooleanField(
47                        default=True, help_text="Delete all active sessions for the user"
48                    ),
49                ),
50                (
51                    "revoke_tokens",
52                    models.BooleanField(
53                        default=True,
54                        help_text="Revoke all tokens for the user (API, app password, recovery, verification, OAuth)",
55                    ),
56                ),
57                (
58                    "self_service_completion_flow",
59                    models.ForeignKey(
60                        blank=True,
61                        help_text="Flow to redirect users to after self-service lockdown. This flow should not require authentication since the user's session is deleted.",
62                        null=True,
63                        on_delete=django.db.models.deletion.SET_NULL,
64                        related_name="account_lockdown_stages",
65                        to="authentik_flows.flow",
66                    ),
67                ),
68            ],
69            options={
70                "verbose_name": "Account Lockdown Stage",
71                "verbose_name_plural": "Account Lockdown Stages",
72            },
73            bases=("authentik_flows.stage",),
74        ),
75    ]

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 = [('authentik_flows', '0031_alter_flow_layout')]
operations = [<CreateModel name='AccountLockdownStage', fields=[('stage_ptr', <django.db.models.fields.related.OneToOneField>), ('deactivate_user', <django.db.models.fields.BooleanField>), ('set_unusable_password', <django.db.models.fields.BooleanField>), ('delete_sessions', <django.db.models.fields.BooleanField>), ('revoke_tokens', <django.db.models.fields.BooleanField>), ('self_service_completion_flow', <django.db.models.fields.related.ForeignKey>)], options={'verbose_name': 'Account Lockdown Stage', 'verbose_name_plural': 'Account Lockdown Stages'}, bases=('authentik_flows.stage',)>]