"""add first_name and last_name to user_tenants

Revision ID: a1b2c3d4e5f6
Revises: 8c9bad3da37f
Create Date: 2026-05-06 00:00:00.000000

"""
from typing import Sequence, Union
import sqlalchemy as sa
from alembic import op

revision: str = "a1b2c3d4e5f6"
down_revision: Union[str, None] = "8c9bad3da37f"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    op.add_column(
        "user_tenants",
        sa.Column("first_name", sa.String(100), nullable=True,
                  comment="Nombre (caché local de Keycloak)"),
        schema="core",
    )
    op.add_column(
        "user_tenants",
        sa.Column("last_name", sa.String(100), nullable=True,
                  comment="Apellido (caché local de Keycloak)"),
        schema="core",
    )


def downgrade() -> None:
    op.drop_column("user_tenants", "last_name", schema="core")
    op.drop_column("user_tenants", "first_name", schema="core")
