"""Add vfs_storages table

Revision ID: de1032a11cca
Revises: fa3dd7f77c19
Create Date: 2025-10-13 05:45:41.699271

"""

import sqlalchemy as sa
from alembic import op

from ai.backend.manager.models.base import GUID

# revision identifiers, used by Alembic.
revision = "de1032a11cca"
down_revision = "fa3dd7f77c19"
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "vfs_storages",
        sa.Column("id", GUID(), server_default=sa.text("uuid_generate_v4()"), nullable=False),
        sa.Column("name", sa.String(), nullable=False),
        sa.Column("host", sa.String(), nullable=False),
        sa.Column("base_path", sa.String(), nullable=False),
        sa.PrimaryKeyConstraint("id", name=op.f("pk_vfs_storages")),
    )
    op.create_index(op.f("ix_vfs_storages_name"), "vfs_storages", ["name"], unique=True)
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f("ix_vfs_storages_name"), table_name="vfs_storages")
    op.drop_table("vfs_storages")
    # ### end Alembic commands ###
