"""Backfill ``search_vector`` for existing AlumniProfile rows.

Migration 0003 added the trigger and a backfill UPDATE that only touched
``updated_at`` — but ``updated_at`` is not in the trigger's watched-column
list, so the function never fired and existing rows kept ``search_vector``
NULL. This migration re-fires the trigger by self-updating ``user_id``,
which IS watched.
"""
from django.db import migrations


BACKFILL_FORWARD_SQL = """
UPDATE alumni_profiles_alumniprofile SET user_id = user_id;
"""


class Migration(migrations.Migration):

    dependencies = [
        ("alumni_profiles", "0005_rename_alumni_prof_employerfb_idx_alumni_prof_profile_1f8ade_idx"),
    ]

    operations = [
        migrations.RunSQL(BACKFILL_FORWARD_SQL, reverse_sql=migrations.RunSQL.noop),
    ]
