"""add_history_log_model Revision ID: 8abfcf44523f Revises: 50548f4984b0 Create Date: 2024-07-11 16:00:53.550080 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '8abfcf44523f' down_revision = '50548f4984b0' branch_labels = None depends_on = None def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.create_table('history_log', sa.Column('id', sa.Integer(), nullable=False), sa.Column('updated_at', sa.DateTime(), nullable=False), sa.Column('deleted_at', sa.DateTime(), nullable=True), sa.Column('created_at', sa.DateTime(), nullable=False), sa.Column('status', sa.String(length=32), nullable=False), sa.Column('trace_id', sa.String(length=36), nullable=False), sa.Column('_type', sa.String(length=32), nullable=False), sa.Column('org_id', sa.String(length=64), nullable=False), sa.Column('cluster_id', sa.String(length=64), nullable=False), sa.Column('database', sa.String(length=64), nullable=False), sa.Column('question', sa.String(length=1024), nullable=False), sa.Column('start_at', sa.DateTime(), nullable=False), sa.Column('session_id', sa.Integer(), nullable=False), sa.Column('data_summary_id', sa.Integer(), nullable=False), sa.Column('input', sa.JSON(), nullable=False), sa.Column('output', sa.JSON(), nullable=False), sa.Column('recalled_knowledge_data', sa.JSON(), nullable=False), sa.Column('settings', sa.JSON(), nullable=False), sa.Column('token_count', sa.Integer(), nullable=False), sa.PrimaryKeyConstraint('id') ) op.create_index(op.f('ix_history_log__type'), 'history_log', ['_type'], unique=False) op.create_index(op.f('ix_history_log_cluster_id'), 'history_log', ['cluster_id'], unique=False) op.create_index(op.f('ix_history_log_created_at'), 'history_log', ['created_at'], unique=False) op.create_index(op.f('ix_history_log_database'), 'history_log', ['database'], unique=False) op.create_index(op.f('ix_history_log_org_id'), 'history_log', ['org_id'], unique=False) op.create_index(op.f('ix_history_log_trace_id'), 'history_log', ['trace_id'], unique=False) # ### end Alembic commands ### def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.drop_index(op.f('ix_history_log_trace_id'), table_name='history_log') op.drop_index(op.f('ix_history_log_org_id'), table_name='history_log') op.drop_index(op.f('ix_history_log_database'), table_name='history_log') op.drop_index(op.f('ix_history_log_created_at'), table_name='history_log') op.drop_index(op.f('ix_history_log_cluster_id'), table_name='history_log') op.drop_index(op.f('ix_history_log__type'), table_name='history_log') op.drop_table('history_log') # ### end Alembic commands ###