authentik.stages.password.migrations.0001_initial

 1# Generated by Django 3.0.6 on 2020-05-19 22:08
 2
 3import django.contrib.postgres.fields
 4import django.db.models.deletion
 5from django.db import migrations, models
 6
 7
 8class Migration(migrations.Migration):
 9    initial = True
10
11    dependencies = [
12        ("authentik_flows", "0001_initial"),
13    ]
14
15    operations = [
16        migrations.CreateModel(
17            name="PasswordStage",
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                    "backends",
32                    django.contrib.postgres.fields.ArrayField(
33                        base_field=models.TextField(),
34                        help_text="Selection of backends to test the password against.",
35                        size=None,
36                    ),
37                ),
38            ],
39            options={
40                "verbose_name": "Password Stage",
41                "verbose_name_plural": "Password Stages",
42            },
43            bases=("authentik_flows.stage",),
44        ),
45    ]
class Migration(django.db.migrations.migration.Migration):
 9class Migration(migrations.Migration):
10    initial = True
11
12    dependencies = [
13        ("authentik_flows", "0001_initial"),
14    ]
15
16    operations = [
17        migrations.CreateModel(
18            name="PasswordStage",
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                    "backends",
33                    django.contrib.postgres.fields.ArrayField(
34                        base_field=models.TextField(),
35                        help_text="Selection of backends to test the password against.",
36                        size=None,
37                    ),
38                ),
39            ],
40            options={
41                "verbose_name": "Password Stage",
42                "verbose_name_plural": "Password Stages",
43            },
44            bases=("authentik_flows.stage",),
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.

initial = True
dependencies = [('authentik_flows', '0001_initial')]
operations = [<CreateModel name='PasswordStage', fields=[('stage_ptr', <django.db.models.fields.related.OneToOneField>), ('backends', <django.contrib.postgres.fields.array.ArrayField>)], options={'verbose_name': 'Password Stage', 'verbose_name_plural': 'Password Stages'}, bases=('authentik_flows.stage',)>]