# Generated by Django 4.1.3 on 2022-11-23 09:08

import anfema_django_utils.db.triggers
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='RelatedModel',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField(default='default content')),
            ],
        ),
        migrations.CreateModel(
            name='DenyFieldUpdateTriggerTestModel',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('set_once_flag', models.BooleanField()),
                ('content', models.TextField(default='default content')),
                (
                    'related_model',
                    models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='test_app.relatedmodel'),
                ),
            ],
        ),
        migrations.AddConstraint(
            model_name='denyfieldupdatetriggertestmodel',
            constraint=anfema_django_utils.db.triggers.DenyFieldUpdateTrigger(
                field='set_once_flag', name='test_deny_set_once_flag_update'
            ),
        ),
        migrations.AddConstraint(
            model_name='denyfieldupdatetriggertestmodel',
            constraint=anfema_django_utils.db.triggers.DenyFieldUpdateTrigger(
                field='related_model_id', name='test_deny_related_model_id_update'
            ),
        ),
    ]
