"""empty message

Revision ID: f617930e8201
Revises: 812b93ec54d5
Create Date: 2026-03-25 09:18:34.128706

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


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


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('skills',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('description', sa.String(), nullable=False),
    sa.Column('is_enabled', sa.Boolean(), nullable=False),
    sa.Column('content', sa.String(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('skill_resources',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('relative', sa.String(), nullable=False),
    sa.Column('content', sa.String(), nullable=False),
    sa.Column('_skill_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['_skill_id'], ['skills.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    with op.batch_alter_table('providers', schema=None) as batch_op:
        batch_op.alter_column('type',
               existing_type=sa.VARCHAR(length=6),
               type_=sa.Enum('OPENAI', 'ANTHROPIC', name='llmproviders'),
               existing_nullable=False)

    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('providers', schema=None) as batch_op:
        batch_op.alter_column('type',
               existing_type=sa.Enum('OPENAI', 'ANTHROPIC', name='llmproviders'),
               type_=sa.VARCHAR(length=6),
               existing_nullable=False)

    op.drop_table('skill_resources')
    op.drop_table('skills')
    # ### end Alembic commands ###
