"""rename briefing_date to day_date and drop existing briefing conversations

Revision ID: 0040
Revises: 0039
Create Date: 2026-04-25

This is a hard-cut migration accompanying the Journal feature. The user
has accepted destruction of existing briefing data per the design spec.
"""
from alembic import op


revision = "0040"
down_revision = "0039"
branch_labels = None
depends_on = None


def upgrade() -> None:
    op.execute("DELETE FROM conversations WHERE conversation_type = 'briefing'")
    op.alter_column("conversations", "briefing_date", new_column_name="day_date")
    op.execute("DELETE FROM settings WHERE key = 'briefing_config'")


def downgrade() -> None:
    op.alter_column("conversations", "day_date", new_column_name="briefing_date")
