"""Add click_id + destination_url to yield transactions.

Revision ID: 011_add_yield_transaction_click_id
Revises: 010_add_yield_connected_at
Create Date: 2025-12-15
"""

from alembic import op
import sqlalchemy as sa


revision = "011_add_yield_transaction_click_id"
down_revision = "010_add_yield_connected_at"
branch_labels = None
depends_on = None


def upgrade() -> None:
    op.add_column("yield_transactions", sa.Column("click_id", sa.String(length=64), nullable=True))
    op.add_column("yield_transactions", sa.Column("destination_url", sa.Text(), nullable=True))
    op.create_index("ix_yield_transactions_click_id", "yield_transactions", ["click_id"], unique=False)


def downgrade() -> None:
    op.drop_index("ix_yield_transactions_click_id", table_name="yield_transactions")
    op.drop_column("yield_transactions", "destination_url")
    op.drop_column("yield_transactions", "click_id")

