"""playlist synced_video_ids (S7: 3-way merge baseline for two-way YouTube sync) The one-directional "local wins" push is replaced by a 3-way merge that classifies each item against the last-synced state. That needs the raw ordered id set as a baseline, not just the `synced_fingerprint` hash. Add a nullable `synced_video_ids` (JSON list) column; NULL on every existing row means "no baseline yet" — the first merge then unions losslessly and records one. Forward-only in practice (a downgrade just drops the column). """ from typing import Sequence, Union import sqlalchemy as sa from alembic import op revision: str = "0075_playlist_sync_baseline" down_revision: Union[str, None] = "0074_download_credentials" branch_labels: Union[str, Sequence[str], None] = None depends_on: Union[str, Sequence[str], None] = None def upgrade() -> None: op.add_column("playlists", sa.Column("synced_video_ids", sa.Text(), nullable=True)) def downgrade() -> None: op.drop_column("playlists", "synced_video_ids")