"""add_knowledge_base Revision ID: 669c7a8cd5a9 Revises: 96ef20412ffe Create Date: 2024-05-27 14:24:27.816003 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '669c7a8cd5a9' down_revision = '96ef20412ffe' branch_labels = None depends_on = None def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.create_table('knowledge_base', sa.Column('id', sa.Integer(), nullable=False), sa.Column('created_at', sa.DateTime(), nullable=False), sa.Column('updated_at', sa.DateTime(), nullable=False), sa.Column('deleted_at', sa.DateTime(), nullable=True), sa.Column('cluster_id', sa.String(length=64), nullable=False), sa.Column('db_name', sa.String(length=64), nullable=False), sa.Column('description', sa.String(length=4096), nullable=False), sa.Column('is_default', sa.Boolean(), nullable=False), sa.PrimaryKeyConstraint('id') ) op.create_index(op.f('ix_knowledge_base_cluster_id'), 'knowledge_base', ['cluster_id'], unique=False) op.add_column('context', sa.Column('description', sa.String(length=4096), nullable=False, server_default=sa.text("''"))) op.add_column('context', sa.Column('is_default', sa.Boolean(), nullable=False, server_default=sa.text('false'))) op.add_column('domain_knowledge', sa.Column('knowledge_base_id', sa.Integer(), nullable=False, server_default=sa.text('0'))) op.create_index(op.f('ix_domain_knowledge_knowledge_base_id'), 'domain_knowledge', ['knowledge_base_id'], unique=False) # ### end Alembic commands ### def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.drop_index(op.f('ix_domain_knowledge_knowledge_base_id'), table_name='domain_knowledge') op.drop_column('domain_knowledge', 'knowledge_base_id') op.drop_column('context', 'is_default') op.drop_column('context', 'description') op.drop_index(op.f('ix_knowledge_base_cluster_id'), table_name='knowledge_base') op.drop_table('knowledge_base') # ### end Alembic commands ###