"""Adding Processor Model

Revision ID: 95f82a301dff
Revises: 7872ffdbac6c
Create Date: 2024-11-11 11:26:23.103689

"""
from alembic import op
import sqlalchemy as sa
import pgvector
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = '95f82a301dff'
down_revision = '7872ffdbac6c'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('processor',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('name', sa.String(length=50), nullable=False),
                    sa.Column('description', sa.Text(), nullable=True),
                    sa.Column('catalog_id', sa.Integer(), nullable=True),
                    sa.Column('type', sa.String(length=50), nullable=False),
                    sa.Column('min_chunk_size', sa.Integer(), nullable=True),
                    sa.Column('max_chunk_size', sa.Integer(), nullable=True),
                    sa.Column('tuning', sa.Boolean(), nullable=True),
                    sa.Column('user_metadata', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
                    sa.Column('system_metadata', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
                    sa.Column('configuration', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
                    sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=False),
                    sa.Column('created_by', sa.Integer(), nullable=True),
                    sa.Column('updated_at', sa.DateTime(), server_default=sa.text('now()'), nullable=False),
                    sa.Column('updated_by', sa.Integer(), nullable=True),
                    sa.ForeignKeyConstraint(['catalog_id'], ['catalog.id'], ),
                    sa.ForeignKeyConstraint(['created_by'], ['public.user.id'], ),
                    sa.ForeignKeyConstraint(['updated_by'], ['public.user.id'], ),
                    sa.PrimaryKeyConstraint('id')
                    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('processor')
    # ### end Alembic commands ###
