# Generated by Django 5.2.11 on 2026-07-01 21:59

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0032_inboundmessage_blob_envelope'),
    ]

    operations = [
        migrations.AddField(
            model_name='channel',
            name='is_active',
            field=models.BooleanField(default=True, help_text='Uncheck to pause this channel without deleting it.', verbose_name='active'),
        ),
        migrations.AddIndex(
            model_name='channel',
            index=models.Index(fields=['type', 'is_active'], name='channel_type_active_idx'),
        ),
        # Drop the field-level index on last_used_at: the column is rewritten
        # by every (throttled) heartbeat and API-key auth, and indexing it
        # defeats PostgreSQL HOT updates on that hot write path. Nothing needs
        # it — the import scheduler's due-scan narrows on
        # channel_type_active_idx and evaluates the staleness residually (see
        # Channel.Meta).
        migrations.AlterField(
            model_name='channel',
            name='last_used_at',
            field=models.DateTimeField(blank=True, help_text='Operational timestamp updated (throttled) whenever the channel is used.', null=True, verbose_name='last used at'),
        ),
    ]
