authentik.events.migrations.0019_notificationrulenotificationtransport_and_more

 1# Generated by Django 5.2.15 on 2026-06-23 15:35
 2
 3import django.db.models.deletion
 4from django.db import migrations, models
 5
 6
 7class Migration(migrations.Migration):
 8
 9    dependencies = [
10        ("authentik_events", "0018_event_authentik_e_user_pk__idx"),
11    ]
12
13    operations = [
14        migrations.SeparateDatabaseAndState(
15            database_operations=[],
16            state_operations=[
17                migrations.CreateModel(
18                    name="NotificationRuleNotificationTransport",
19                    fields=[
20                        (
21                            "id",
22                            models.AutoField(
23                                auto_created=True,
24                                primary_key=True,
25                                serialize=False,
26                                verbose_name="ID",
27                            ),
28                        ),
29                        (
30                            "notification_rule",
31                            models.ForeignKey(
32                                db_column="notificationrule_id",
33                                on_delete=django.db.models.deletion.CASCADE,
34                                to="authentik_events.notificationrule",
35                            ),
36                        ),
37                        (
38                            "notification_transport",
39                            models.ForeignKey(
40                                db_column="notificationtransport_id",
41                                on_delete=django.db.models.deletion.CASCADE,
42                                to="authentik_events.notificationtransport",
43                            ),
44                        ),
45                    ],
46                    options={
47                        "db_table": "authentik_events_notificationrule_transports",
48                        "unique_together": {("notification_rule", "notification_transport")},
49                        "verbose_name": "Notification Rule Notification Transport",
50                        "verbose_name_plural": "Notification Rule Notification Transports",
51                    },
52                ),
53                migrations.AlterField(
54                    model_name="notificationrule",
55                    name="transports",
56                    field=models.ManyToManyField(
57                        blank=True,
58                        help_text="Select which transports should be used to notify the user. Select a transport in Local mode to show the notification in the authentik UI. If none are selected, no notification is created.",
59                        through="authentik_events.NotificationRuleNotificationTransport",
60                        to="authentik_events.notificationtransport",
61                    ),
62                ),
63            ],
64        ),
65    ]
class Migration(django.db.migrations.migration.Migration):
 8class Migration(migrations.Migration):
 9
10    dependencies = [
11        ("authentik_events", "0018_event_authentik_e_user_pk__idx"),
12    ]
13
14    operations = [
15        migrations.SeparateDatabaseAndState(
16            database_operations=[],
17            state_operations=[
18                migrations.CreateModel(
19                    name="NotificationRuleNotificationTransport",
20                    fields=[
21                        (
22                            "id",
23                            models.AutoField(
24                                auto_created=True,
25                                primary_key=True,
26                                serialize=False,
27                                verbose_name="ID",
28                            ),
29                        ),
30                        (
31                            "notification_rule",
32                            models.ForeignKey(
33                                db_column="notificationrule_id",
34                                on_delete=django.db.models.deletion.CASCADE,
35                                to="authentik_events.notificationrule",
36                            ),
37                        ),
38                        (
39                            "notification_transport",
40                            models.ForeignKey(
41                                db_column="notificationtransport_id",
42                                on_delete=django.db.models.deletion.CASCADE,
43                                to="authentik_events.notificationtransport",
44                            ),
45                        ),
46                    ],
47                    options={
48                        "db_table": "authentik_events_notificationrule_transports",
49                        "unique_together": {("notification_rule", "notification_transport")},
50                        "verbose_name": "Notification Rule Notification Transport",
51                        "verbose_name_plural": "Notification Rule Notification Transports",
52                    },
53                ),
54                migrations.AlterField(
55                    model_name="notificationrule",
56                    name="transports",
57                    field=models.ManyToManyField(
58                        blank=True,
59                        help_text="Select which transports should be used to notify the user. Select a transport in Local mode to show the notification in the authentik UI. If none are selected, no notification is created.",
60                        through="authentik_events.NotificationRuleNotificationTransport",
61                        to="authentik_events.notificationtransport",
62                    ),
63                ),
64            ],
65        ),
66    ]

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_events', '0018_event_authentik_e_user_pk__idx')]
operations = [<SeparateDatabaseAndState database_operations=[], state_operations=[<CreateModel name='NotificationRuleNotificationTransport', fields=[('id', <django.db.models.fields.AutoField>), ('notification_rule', <django.db.models.fields.related.ForeignKey>), ('notification_transport', <django.db.models.fields.related.ForeignKey>)], options={'db_table': 'authentik_events_notificationrule_transports', 'unique_together': {('notification_rule', 'notification_transport')}, 'verbose_name': 'Notification Rule Notification Transport', 'verbose_name_plural': 'Notification Rule Notification Transports'}>, <AlterField model_name='notificationrule', name='transports', field=<django.db.models.fields.related.ManyToManyField>>]>]