# Generated by Django 5.2.15 on 2026-06-18 18:19
#
# Creates the FitComplianceFilter table unconditionally, even on sites where
# allianceauth-securegroups is NOT installed. This is deliberate: the model class
# itself is only defined when securegroups is present (see
# fitcheck/models/securegroups.py), but the table must already exist so that a
# site which enables securegroups *after* its initial install gets a working
# filter without anyone having to run makemigrations on production. The operation
# is self-contained (the abstract FilterBase's name/description fields are copied
# in) and imports nothing from securegroups, so it applies cleanly with or without
# the package. When securegroups is absent the table simply sits unused.

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


class Migration(migrations.Migration):

    dependencies = [
        ('fitcheck', '0025_doctrinefit_feb_frigate_type_ids'),
    ]

    operations = [
        migrations.CreateModel(
            name='FitComplianceFilter',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=500)),
                ('description', models.CharField(max_length=500)),
                ('require_approved', models.BooleanField(default=False, help_text='Require a reviewer-approved submission, not just a passing engine verdict.')),
                ('require_current', models.BooleanField(default=True, help_text="Require the submission to be graded against the fit's current version (ignore stale submissions).")),
                ('doctrine', models.ForeignKey(blank=True, help_text='Require compliance with any one fit graded under this doctrine.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='fitcheck.doctrine')),
                ('fit', models.ForeignKey(blank=True, help_text='Require compliance with this specific fitting standard.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='fitcheck.doctrinefit')),
            ],
            options={
                'verbose_name': 'Smart Filter: Fit Compliance',
                'verbose_name_plural': 'Smart Filter: Fit Compliance',
            },
        ),
    ]
