# Generated by Django 5.2.11 on 2026-02-27 16:35

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("siege_geo", "0001_initial"),
    ]

    operations = [
        migrations.AddField(
            model_name="tract",
            name="urbanicity_code",
            field=models.PositiveSmallIntegerField(
                blank=True,
                db_index=True,
                help_text="NCES locale code (11-43)",
                null=True,
            ),
        ),
        migrations.AddIndex(
            model_name="tract",
            index=models.Index(
                fields=["urbanicity_code"], name="siege_geo_t_urbanic_0de5c2_idx"
            ),
        ),
        migrations.AddConstraint(
            model_name="block",
            constraint=models.CheckConstraint(
                condition=models.Q(("geoid__regex", "^\\d{15}$")),
                name="block_geoid_15_digits",
            ),
        ),
        migrations.AddConstraint(
            model_name="blockgroup",
            constraint=models.CheckConstraint(
                condition=models.Q(("geoid__regex", "^\\d{12}$")),
                name="blockgroup_geoid_12_digits",
            ),
        ),
        migrations.AddConstraint(
            model_name="congressionaldistrict",
            constraint=models.CheckConstraint(
                condition=models.Q(("geoid__regex", "^\\d{4}$")),
                name="cd_geoid_4_digits",
            ),
        ),
        migrations.AddConstraint(
            model_name="county",
            constraint=models.CheckConstraint(
                condition=models.Q(("geoid__regex", "^\\d{5}$")),
                name="county_geoid_5_digits",
            ),
        ),
        migrations.AddConstraint(
            model_name="place",
            constraint=models.CheckConstraint(
                condition=models.Q(("geoid__regex", "^\\d{7}$")),
                name="place_geoid_7_digits",
            ),
        ),
        migrations.AddConstraint(
            model_name="state",
            constraint=models.CheckConstraint(
                condition=models.Q(("geoid__regex", "^\\d{2}$")),
                name="state_geoid_2_digits",
            ),
        ),
        migrations.AddConstraint(
            model_name="statelegislativelower",
            constraint=models.CheckConstraint(
                condition=models.Q(("geoid__regex", "^\\d{5}$")),
                name="sldl_geoid_5_digits",
            ),
        ),
        migrations.AddConstraint(
            model_name="statelegislativeupper",
            constraint=models.CheckConstraint(
                condition=models.Q(("geoid__regex", "^\\d{5}$")),
                name="sldu_geoid_5_digits",
            ),
        ),
        migrations.AddConstraint(
            model_name="tract",
            constraint=models.CheckConstraint(
                condition=models.Q(("geoid__regex", "^\\d{11}$")),
                name="tract_geoid_11_digits",
            ),
        ),
        migrations.AddConstraint(
            model_name="vtd",
            constraint=models.CheckConstraint(
                condition=models.Q(("geoid__regex", "^\\d{8}$")),
                name="vtd_geoid_8_digits",
            ),
        ),
        migrations.AddConstraint(
            model_name="zcta",
            constraint=models.CheckConstraint(
                condition=models.Q(("geoid__regex", "^\\d{5}$")),
                name="zcta_geoid_5_digits",
            ),
        ),
    ]
