"""home banners table

Revision ID: 8b722b602a5d
Revises: 437ac94e0c81
Create Date: 2026-05-09 10:03:25.147939

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '8b722b602a5d'
down_revision = '437ac94e0c81'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('home_banners',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('slot', sa.String(length=40), nullable=False),
    sa.Column('title', sa.String(length=180), nullable=True),
    sa.Column('subtitle', sa.Text(), nullable=True),
    sa.Column('image_url', sa.String(length=500), nullable=True),
    sa.Column('cta_label', sa.String(length=60), nullable=True),
    sa.Column('cta_link', sa.String(length=255), nullable=True),
    sa.Column('is_active', sa.Boolean(), nullable=False),
    sa.Column('updated_at', sa.DateTime(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    with op.batch_alter_table('home_banners', schema=None) as batch_op:
        batch_op.create_index(batch_op.f('ix_home_banners_slot'), ['slot'], unique=True)

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('home_banners', schema=None) as batch_op:
        batch_op.drop_index(batch_op.f('ix_home_banners_slot'))

    op.drop_table('home_banners')
    # ### end Alembic commands ###
