authentik.sources.oauth.migrations.0008_groupoauthsourceconnection_and_more

 1# Generated by Django 5.0.7 on 2024-08-01 18:52
 2
 3import django.db.models.deletion
 4from django.db import migrations, models
 5
 6
 7class Migration(migrations.Migration):
 8
 9    dependencies = [
10        ("authentik_core", "0039_source_group_matching_mode_alter_group_name_and_more"),
11        (
12            "authentik_sources_oauth",
13            "0007_oauthsource_oidc_jwks_oauthsource_oidc_jwks_url_and_more",
14        ),
15    ]
16
17    operations = [
18        migrations.CreateModel(
19            name="GroupOAuthSourceConnection",
20            fields=[
21                (
22                    "groupsourceconnection_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.groupsourceconnection",
30                    ),
31                ),
32            ],
33            options={
34                "verbose_name": "Group OAuth Source Connection",
35                "verbose_name_plural": "Group OAuth Source Connections",
36            },
37            bases=("authentik_core.groupsourceconnection",),
38        ),
39        migrations.CreateModel(
40            name="OAuthSourcePropertyMapping",
41            fields=[
42                (
43                    "propertymapping_ptr",
44                    models.OneToOneField(
45                        auto_created=True,
46                        on_delete=django.db.models.deletion.CASCADE,
47                        parent_link=True,
48                        primary_key=True,
49                        serialize=False,
50                        to="authentik_core.propertymapping",
51                    ),
52                ),
53            ],
54            options={
55                "verbose_name": "OAuth Source Property Mapping",
56                "verbose_name_plural": "OAuth Source Property Mappings",
57            },
58            bases=("authentik_core.propertymapping",),
59        ),
60    ]
class Migration(django.db.migrations.migration.Migration):
 8class Migration(migrations.Migration):
 9
10    dependencies = [
11        ("authentik_core", "0039_source_group_matching_mode_alter_group_name_and_more"),
12        (
13            "authentik_sources_oauth",
14            "0007_oauthsource_oidc_jwks_oauthsource_oidc_jwks_url_and_more",
15        ),
16    ]
17
18    operations = [
19        migrations.CreateModel(
20            name="GroupOAuthSourceConnection",
21            fields=[
22                (
23                    "groupsourceconnection_ptr",
24                    models.OneToOneField(
25                        auto_created=True,
26                        on_delete=django.db.models.deletion.CASCADE,
27                        parent_link=True,
28                        primary_key=True,
29                        serialize=False,
30                        to="authentik_core.groupsourceconnection",
31                    ),
32                ),
33            ],
34            options={
35                "verbose_name": "Group OAuth Source Connection",
36                "verbose_name_plural": "Group OAuth Source Connections",
37            },
38            bases=("authentik_core.groupsourceconnection",),
39        ),
40        migrations.CreateModel(
41            name="OAuthSourcePropertyMapping",
42            fields=[
43                (
44                    "propertymapping_ptr",
45                    models.OneToOneField(
46                        auto_created=True,
47                        on_delete=django.db.models.deletion.CASCADE,
48                        parent_link=True,
49                        primary_key=True,
50                        serialize=False,
51                        to="authentik_core.propertymapping",
52                    ),
53                ),
54            ],
55            options={
56                "verbose_name": "OAuth Source Property Mapping",
57                "verbose_name_plural": "OAuth Source Property Mappings",
58            },
59            bases=("authentik_core.propertymapping",),
60        ),
61    ]

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', '0039_source_group_matching_mode_alter_group_name_and_more'), ('authentik_sources_oauth', '0007_oauthsource_oidc_jwks_oauthsource_oidc_jwks_url_and_more')]
operations = [<CreateModel name='GroupOAuthSourceConnection', fields=[('groupsourceconnection_ptr', <django.db.models.fields.related.OneToOneField>)], options={'verbose_name': 'Group OAuth Source Connection', 'verbose_name_plural': 'Group OAuth Source Connections'}, bases=('authentik_core.groupsourceconnection',)>, <CreateModel name='OAuthSourcePropertyMapping', fields=[('propertymapping_ptr', <django.db.models.fields.related.OneToOneField>)], options={'verbose_name': 'OAuth Source Property Mapping', 'verbose_name_plural': 'OAuth Source Property Mappings'}, bases=('authentik_core.propertymapping',)>]