
from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

    dependencies = [
        ("helusers", "0001_add_ad_groups"),
    ]

    operations = [
        migrations.CreateModel(
            name="OIDCBackChannelLogoutEvent",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(default=django.utils.timezone.now)),
                ("iss", models.CharField(db_index=True, max_length=4096)),
                ("sub", models.CharField(blank=True, db_index=True, max_length=4096)),
                ("sid", models.CharField(blank=True, db_index=True, max_length=4096)),
            ],
            options={
                "unique_together": {("iss", "sub", "sid")},
            },
        ),
    ]

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

    dependencies = [
        ("helusers", "0001_add_ad_groups"),
    ]

    operations = [
        migrations.CreateModel(
            name="OIDCBackChannelLogoutEvent",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(default=django.utils.timezone.now)),
                ("iss", models.CharField(db_index=True, max_length=4096)),
                ("sub", models.CharField(blank=True, db_index=True, max_length=4096)),
                ("sid", models.CharField(blank=True, db_index=True, max_length=4096)),
            ],
            options={
                "verbose_name": "OIDC back channel logout event",
                "verbose_name_plural": "OIDC back channel logout events",
                "unique_together": {("iss", "sub", "sid")},
            },
        ),
    ]

Modify migration file to include meta data changes
Modify migration file to include meta data changes

The OIDCBackChannelLogoutEvent model's meta data was changed in commit
f62a72b29f. Although this has no effect on the database, Django still
wants to include the meta data in migrations. Since this migration file
isn't yet included in any release, it can be modified, instead of
creating a new migration file only for the meta data change.

- 
  from django.db import migrations, models
  import django.utils.timezone
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ("helusers", "0001_add_ad_groups"),
      ]
  
      operations = [
          migrations.CreateModel(
              name="OIDCBackChannelLogoutEvent",
              fields=[
                  (
                      "id",
                      models.AutoField(
                          auto_created=True,
                          primary_key=True,
                          serialize=False,
                          verbose_name="ID",
                      ),
                  ),
                  ("created_at", models.DateTimeField(default=django.utils.timezone.now)),
                  ("iss", models.CharField(db_index=True, max_length=4096)),
                  ("sub", models.CharField(blank=True, db_index=True, max_length=4096)),
                  ("sid", models.CharField(blank=True, db_index=True, max_length=4096)),
              ],
              options={
+                 "verbose_name": "OIDC back channel logout event",
+                 "verbose_name_plural": "OIDC back channel logout events",
                  "unique_together": {("iss", "sub", "sid")},
              },
          ),
      ]
  
Modify migration file to include meta data changes
## Code Before:

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

    dependencies = [
        ("helusers", "0001_add_ad_groups"),
    ]

    operations = [
        migrations.CreateModel(
            name="OIDCBackChannelLogoutEvent",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(default=django.utils.timezone.now)),
                ("iss", models.CharField(db_index=True, max_length=4096)),
                ("sub", models.CharField(blank=True, db_index=True, max_length=4096)),
                ("sid", models.CharField(blank=True, db_index=True, max_length=4096)),
            ],
            options={
                "unique_together": {("iss", "sub", "sid")},
            },
        ),
    ]

## Instruction:
Modify migration file to include meta data changes
## Code After:
from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

    dependencies = [
        ("helusers", "0001_add_ad_groups"),
    ]

    operations = [
        migrations.CreateModel(
            name="OIDCBackChannelLogoutEvent",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(default=django.utils.timezone.now)),
                ("iss", models.CharField(db_index=True, max_length=4096)),
                ("sub", models.CharField(blank=True, db_index=True, max_length=4096)),
                ("sid", models.CharField(blank=True, db_index=True, max_length=4096)),
            ],
            options={
                "verbose_name": "OIDC back channel logout event",
                "verbose_name_plural": "OIDC back channel logout events",
                "unique_together": {("iss", "sub", "sid")},
            },
        ),
    ]
