# Generated by Django 3.2.19 on 2025-03-14 11:47

from django.db import migrations, models


def truncate_data(apps, schema_editor):
    OpcionMenuInteractivoWhatsapp = apps.get_model('whatsapp_app', 'OpcionMenuInteractivoWhatsapp')
    for opcion in OpcionMenuInteractivoWhatsapp.objects.all():
        if len(opcion.descripcion) > 72:
            opcion.descripcion = opcion.descripcion[:71] + '*'
            opcion.save()


class Migration(migrations.Migration):

    dependencies = [
        ('whatsapp_app', '0012_add_line_menuinteractivo'),
    ]

    operations = [
        migrations.RunPython(truncate_data, reverse_code=migrations.RunPython.noop),
        migrations.AlterField(
            model_name='menuinteractivowhatsapp',
            name='menu_body',
            field=models.CharField(max_length=1024),
        ),
        migrations.AlterField(
            model_name='menuinteractivowhatsapp',
            name='menu_footer',
            field=models.CharField(blank=True, max_length=60, null=True),
        ),
        migrations.AlterField(
            model_name='menuinteractivowhatsapp',
            name='menu_header',
            field=models.CharField(blank=True, max_length=60, null=True),
        ),
        migrations.AlterField(
            model_name='menuinteractivowhatsapp',
            name='texto_opcion_incorrecta',
            field=models.CharField(blank=True, max_length=100, null=True),
        ),
        migrations.AlterField(
            model_name='opcionmenuinteractivowhatsapp',
            name='descripcion',
            field=models.CharField(default='', max_length=72),
            preserve_default=False,
        ),
    ]
