# Generated by Django 5.0.8 on 2024-12-29 16:38

from django.db import migrations, models


def generate_short_name(apps, schema_editor):
    Position = apps.get_model('mapdata', 'position')
    for position in Position.objects.all():
        position.short_name = position.name[:2]
        position.save()


class Migration(migrations.Migration):

    dependencies = [
        ('mapdata', '0136_wifi_bssids_to_addresses_and_more'),
    ]

    operations = [
        migrations.AddField(
            model_name='position',
            name='short_name',
            field=models.CharField(help_text='two characters maximum', max_length=2, null=True, verbose_name='abbreviation'),
        ),
        migrations.RunPython(generate_short_name, migrations.RunPython.noop),
        migrations.AlterField(
            model_name='position',
            name='short_name',
            field=models.CharField(help_text='two characters maximum', max_length=2, verbose_name='abbreviation'),
        ),
    ]
