authentik.flows.migrations.0020_flowtoken

 1# Generated by Django 3.2.9 on 2021-12-05 13:50
 2
 3import django.db.models.deletion
 4from django.db import migrations, models
 5
 6
 7class Migration(migrations.Migration):
 8    dependencies = [
 9        ("authentik_core", "0018_auto_20210330_1345_squashed_0028_alter_token_intent"),
10        (
11            "authentik_flows",
12            "0019_alter_flow_background_squashed_0024_alter_flow_compatibility_mode",
13        ),
14    ]
15
16    operations = [
17        migrations.CreateModel(
18            name="FlowToken",
19            fields=[
20                (
21                    "token_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_core.token",
29                    ),
30                ),
31                ("_plan", models.TextField()),
32                (
33                    "flow",
34                    models.ForeignKey(
35                        on_delete=django.db.models.deletion.CASCADE, to="authentik_flows.flow"
36                    ),
37                ),
38            ],
39            options={
40                "verbose_name": "Flow Token",
41                "verbose_name_plural": "Flow Tokens",
42            },
43            bases=("authentik_core.token",),
44        ),
45    ]
class Migration(django.db.migrations.migration.Migration):
 8class Migration(migrations.Migration):
 9    dependencies = [
10        ("authentik_core", "0018_auto_20210330_1345_squashed_0028_alter_token_intent"),
11        (
12            "authentik_flows",
13            "0019_alter_flow_background_squashed_0024_alter_flow_compatibility_mode",
14        ),
15    ]
16
17    operations = [
18        migrations.CreateModel(
19            name="FlowToken",
20            fields=[
21                (
22                    "token_ptr",
23                    models.OneToOneField(
24                        auto_created=True,
25                        on_delete=django.db.models.deletion.CASCADE,
26                        parent_link=True,
27                        primary_key=True,
28                        serialize=False,
29                        to="authentik_core.token",
30                    ),
31                ),
32                ("_plan", models.TextField()),
33                (
34                    "flow",
35                    models.ForeignKey(
36                        on_delete=django.db.models.deletion.CASCADE, to="authentik_flows.flow"
37                    ),
38                ),
39            ],
40            options={
41                "verbose_name": "Flow Token",
42                "verbose_name_plural": "Flow Tokens",
43            },
44            bases=("authentik_core.token",),
45        ),
46    ]

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.

dependencies = [('authentik_core', '0018_auto_20210330_1345_squashed_0028_alter_token_intent'), ('authentik_flows', '0019_alter_flow_background_squashed_0024_alter_flow_compatibility_mode')]
operations = [<CreateModel name='FlowToken', fields=[('token_ptr', <django.db.models.fields.related.OneToOneField>), ('_plan', <django.db.models.fields.TextField>), ('flow', <django.db.models.fields.related.ForeignKey>)], options={'verbose_name': 'Flow Token', 'verbose_name_plural': 'Flow Tokens'}, bases=('authentik_core.token',)>]