"""change scope cloud

Revision ID: e6ae1e138c1f
Revises: ee4924ac4f60
Create Date: 2026-01-23 13:02:43.513858

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = 'e6ae1e138c1f'
down_revision: Union[str, Sequence[str], None] = 'ee4924ac4f60'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    # was in development only
    op.execute("DELETE FROM px_cloud_secrets")
    op.execute("DELETE FROM vm_vars_blake")

    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('px_cloud_secrets', sa.Column('cloud_domain', sa.String(length=253), nullable=False))
    op.drop_column('px_cloud_secrets', 'target_pve')

    op.add_column('vm_vars_blake', sa.Column('cloud_domain', sa.String(length=253), nullable=False))
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('vm_vars_blake', 'cloud_domain')
    op.add_column('px_cloud_secrets', sa.Column('target_pve', sa.VARCHAR(length=253), autoincrement=False, nullable=False))
    op.drop_column('px_cloud_secrets', 'cloud_domain')
    # ### end Alembic commands ###
