authentik.policies.migrations.0007_policybindingmodel_policy_engine_mode

 1# Generated by Django 3.1.7 on 2021-03-31 08:19
 2
 3from django.db import migrations, models
 4
 5
 6class Migration(migrations.Migration):
 7    dependencies = [
 8        ("authentik_policies", "0006_auto_20210329_1334"),
 9    ]
10
11    operations = [
12        # Create field with default as all for backwards compat
13        migrations.AddField(
14            model_name="policybindingmodel",
15            name="policy_engine_mode",
16            field=models.TextField(
17                choices=[
18                    ("all", "all, all policies must pass"),
19                    ("any", "any, any policy must pass"),
20                ],
21                default="all",
22            ),
23        ),
24        # Set default for new objects to any
25        migrations.AlterField(
26            model_name="policybindingmodel",
27            name="policy_engine_mode",
28            field=models.TextField(
29                choices=[
30                    ("all", "all, all policies must pass"),
31                    ("any", "any, any policy must pass"),
32                ],
33                default="any",
34            ),
35        ),
36    ]
class Migration(django.db.migrations.migration.Migration):
 7class Migration(migrations.Migration):
 8    dependencies = [
 9        ("authentik_policies", "0006_auto_20210329_1334"),
10    ]
11
12    operations = [
13        # Create field with default as all for backwards compat
14        migrations.AddField(
15            model_name="policybindingmodel",
16            name="policy_engine_mode",
17            field=models.TextField(
18                choices=[
19                    ("all", "all, all policies must pass"),
20                    ("any", "any, any policy must pass"),
21                ],
22                default="all",
23            ),
24        ),
25        # Set default for new objects to any
26        migrations.AlterField(
27            model_name="policybindingmodel",
28            name="policy_engine_mode",
29            field=models.TextField(
30                choices=[
31                    ("all", "all, all policies must pass"),
32                    ("any", "any, any policy must pass"),
33                ],
34                default="any",
35            ),
36        ),
37    ]

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_policies', '0006_auto_20210329_1334')]
operations = [<AddField model_name='policybindingmodel', name='policy_engine_mode', field=<django.db.models.fields.TextField>>, <AlterField model_name='policybindingmodel', name='policy_engine_mode', field=<django.db.models.fields.TextField>>]