"""Add social networks table

Revision ID: 270dba323212
Revises: a4d1bc4b8376
Create Date: 2025-06-24 18:04:09.115176

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '270dba323212'
down_revision = 'a4d1bc4b8376'
branch_labels = None
depends_on = None


def upgrade():
    pass
    # ### commands auto generated by Alembic - please adjust! ###
    # Verificar si la tabla ya existe antes de intentar crearla
    # conn = op.get_bind()
    # inspector = sa.inspect(conn)
    # tables = inspector.get_table_names()
    
    # if 'social_networks' not in tables:
    #     op.create_table('social_networks',
    #     sa.Column('id', sa.Integer(), nullable=False),
    #     sa.Column('name', sa.String(length=50), nullable=False),
    #     sa.Column('icon', sa.String(length=50), nullable=True),
    #     sa.Column('color', sa.String(length=20), nullable=True),
    #     sa.Column('url_pattern', sa.String(length=255), nullable=False),
    #     sa.Column('is_active', sa.Boolean(), nullable=True),
    #     sa.Column('position', sa.Integer(), nullable=True),
    #     sa.Column('requires_mobile', sa.Boolean(), nullable=True),
    #     sa.Column('created_at', sa.DateTime(), nullable=True),
    #     sa.Column('updated_at', sa.DateTime(), nullable=True),
    #     sa.PrimaryKeyConstraint('id')
    #     )
    # ### end Alembic commands ###


def downgrade():
    pass
    # ### commands auto generated by Alembic - please adjust! ###
    # Verificar si la tabla existe antes de intentar eliminarla
    # conn = op.get_bind()
    # inspector = sa.inspect(conn)
    # tables = inspector.get_table_names()
    
    # if 'social_networks' in tables:
    #     op.drop_table('social_networks')
    # ### end Alembic commands ###
