"""promote platform admin mobiles

Revision ID: 0003_platform_admin
Revises: 0002_users
Create Date: 2026-07-07
"""
from __future__ import annotations

from typing import Sequence, Union

from alembic import op

revision: str = "0003_platform_admin"
down_revision: Union[str, None] = "0002_users"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    op.execute(
        """
        UPDATE users
        SET role = 'platform_admin'
        WHERE mobile IN ('09155105404', '9155105404')
        """
    )


def downgrade() -> None:
    op.execute(
        """
        UPDATE users
        SET role = 'pending_tenant_admin'
        WHERE mobile IN ('09155105404', '9155105404')
          AND role = 'platform_admin'
        """
    )
