"""global_ssh_credentials table Revision ID: 0012 Revises: 0011 Create Date: 2026-04-09 """ from alembic import op import sqlalchemy as sa revision = "0012" down_revision = "0011" branch_labels = None depends_on = None def upgrade() -> None: op.create_table( "global_ssh_credentials", sa.Column("id", sa.Integer(), primary_key=True), sa.Column("type", sa.String(10), nullable=False), sa.Column("username", sa.String(100), nullable=False), sa.Column("password_enc", sa.String(500), nullable=True), sa.Column( "ssh_key_id", sa.Integer(), sa.ForeignKey("ssh_keys.id", ondelete="SET NULL"), nullable=True, ), sa.Column("priority", sa.Integer(), nullable=False, server_default="0"), sa.Column("description", sa.String(200), nullable=True), sa.CheckConstraint("type IN ('password', 'key')", name="ck_global_ssh_cred_type"), ) op.create_index("ix_global_ssh_creds_priority", "global_ssh_credentials", ["priority"]) def downgrade() -> None: op.drop_index("ix_global_ssh_creds_priority", table_name="global_ssh_credentials") op.drop_table("global_ssh_credentials")