"""Feedback V2 homepage media and activity fields

Revision ID: f2b8c6d3a921
Revises: e9a4c7d2f115
Create Date: 2026-10-08
"""
from alembic import op
import sqlalchemy as sa

revision = "f2b8c6d3a921"
down_revision = "e9a4c7d2f115"
branch_labels = None
depends_on = None


def upgrade():
    op.add_column("activities", sa.Column("google_maps_url", sa.String(length=1000), nullable=True))
    op.add_column("activities", sa.Column("provides_tshirt", sa.Boolean(), nullable=False, server_default=sa.false()))

    op.create_table(
        "home_media",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("media_type", sa.String(length=40), nullable=False),
        sa.Column("media_key", sa.String(length=80), nullable=True),
        sa.Column("title", sa.String(length=255), nullable=True),
        sa.Column("subtitle", sa.String(length=500), nullable=True),
        sa.Column("file_path", sa.String(length=500), nullable=False),
        sa.Column("sort_order", sa.Integer(), nullable=False, server_default="0"),
        sa.Column("is_active", sa.Boolean(), nullable=False, server_default=sa.true()),
        sa.Column("created_at", sa.DateTime(), nullable=False),
        sa.Column("updated_at", sa.DateTime(), nullable=False),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_index(op.f("ix_home_media_media_type"), "home_media", ["media_type"], unique=False)
    op.create_index(op.f("ix_home_media_media_key"), "home_media", ["media_key"], unique=False)
    op.create_index(op.f("ix_home_media_is_active"), "home_media", ["is_active"], unique=False)


def downgrade():
    op.drop_index(op.f("ix_home_media_is_active"), table_name="home_media")
    op.drop_index(op.f("ix_home_media_media_key"), table_name="home_media")
    op.drop_index(op.f("ix_home_media_media_type"), table_name="home_media")
    op.drop_table("home_media")
    op.drop_column("activities", "provides_tshirt")
    op.drop_column("activities", "google_maps_url")
