# Generated by Django 3.2.12 on 2023-05-15 11:42

from django.db import migrations, models
from pgpubsub.models import Notification


class Migration(migrations.Migration):

    dependencies = [
        ('pgpubsub', '0002_notification_created_at'),
    ]

    operations = [
        migrations.AddField(
            model_name='notification',
            name='db_version',
            field=models.IntegerField(null=True),
        ),
        migrations.RunSQL(
            sql=f"""
                ALTER TABLE {Notification._meta.db_table}
                ADD CONSTRAINT pgpubsub_notification_db_version_fk
                FOREIGN KEY (db_version)
                REFERENCES django_migrations(id)
                ON DELETE RESTRICT
            """,
            reverse_sql=f"""
                ALTER TABLE {Notification._meta.db_table}
                DROP CONSTRAINT pgpubsub_notification_db_version_fk
            """,
        ),
    ]
