"""Add secret storage

Revision ID: 897c39909e73
Revises: 7c330aebf8e7
Create Date: 2025-10-17 20:42:40.528077

"""

import sqlalchemy as sa

from alembic import op
from db_models.custom_types import EncryptedJSON

# revision identifiers, used by Alembic.
revision = "897c39909e73"
down_revision = "7c330aebf8e7"
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "secret_storage",
        sa.Column("id", sa.String(), nullable=False),
        sa.Column("name", sa.String(), nullable=False),
        sa.Column("value", EncryptedJSON(), nullable=False),
        sa.Column("secret_type", sa.String(), nullable=False),
        sa.Column("created_at", sa.TIMESTAMP(), nullable=False),
        sa.Column("updated_at", sa.TIMESTAMP(), nullable=False),
        sa.PrimaryKeyConstraint("id"),
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("secret_storage")
    # ### end Alembic commands ###
