"""20251118215552

Revision ID: 9a887a617afb
Revises: 29c030316adf
Create Date: 2025-11-18 21:55:53.308600

"""
from typing import Sequence, Union

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

# revision identifiers, used by Alembic.
revision: str = '9a887a617afb'
down_revision: Union[str, None] = '29c030316adf'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('data_config')
    op.add_column('app_releases', sa.Column('release_notes', sa.String(), nullable=True, comment='版本说明'))
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('app_releases', 'release_notes')
    op.create_table('data_config',
    sa.Column('config_id', sa.INTEGER(), autoincrement=True, nullable=False),
    sa.Column('config_name', sa.VARCHAR(), autoincrement=False, nullable=False),
    sa.Column('config_desc', sa.VARCHAR(), autoincrement=False, nullable=True),
    sa.Column('group_id', sa.VARCHAR(), autoincrement=False, nullable=True),
    sa.Column('user_id', sa.VARCHAR(), autoincrement=False, nullable=True),
    sa.Column('apply_id', sa.VARCHAR(), autoincrement=False, nullable=True),
    sa.Column('id', sa.VARCHAR(), autoincrement=False, nullable=True),
    sa.Column('enable_llm_dedup_blockwise', sa.BOOLEAN(), server_default=sa.text('true'), autoincrement=False, nullable=True),
    sa.Column('enable_llm_disambiguation', sa.BOOLEAN(), server_default=sa.text('true'), autoincrement=False, nullable=True),
    sa.Column('deep_retrieval', sa.BOOLEAN(), server_default=sa.text('true'), autoincrement=False, nullable=True),
    sa.Column('t_type_strict', sa.DOUBLE_PRECISION(precision=53), server_default=sa.text('0.8'), autoincrement=False, nullable=True),
    sa.Column('t_name_strict', sa.DOUBLE_PRECISION(precision=53), server_default=sa.text('0.8'), autoincrement=False, nullable=True),
    sa.Column('t_overall', sa.DOUBLE_PRECISION(precision=53), server_default=sa.text('0.8'), autoincrement=False, nullable=True),
    sa.Column('state', sa.BOOLEAN(), server_default=sa.text('false'), autoincrement=False, nullable=True),
    sa.Column('chunker_strategy', sa.VARCHAR(), server_default=sa.text("'RecursiveChunker'::character varying"), autoincrement=False, nullable=True),
    sa.Column('pruning_enabled', sa.BOOLEAN(), server_default=sa.text('false'), autoincrement=False, nullable=True),
    sa.Column('pruning_scene', sa.VARCHAR(), autoincrement=False, nullable=True),
    sa.Column('pruning_threshold', sa.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True),
    sa.Column('enable_self_reflexion', sa.BOOLEAN(), server_default=sa.text('false'), autoincrement=False, nullable=True),
    sa.Column('iteration_period', sa.VARCHAR(), server_default=sa.text("'三小时'::character varying"), autoincrement=False, nullable=True),
    sa.Column('reflexion_range', sa.VARCHAR(), server_default=sa.text("'部分'::character varying"), autoincrement=False, nullable=True),
    sa.Column('baseline', sa.VARCHAR(), server_default=sa.text("'时间'::character varying"), autoincrement=False, nullable=True),
    sa.Column('statement_granularity', sa.INTEGER(), server_default=sa.text('2'), autoincrement=False, nullable=True),
    sa.Column('include_dialogue_context', sa.BOOLEAN(), server_default=sa.text('false'), autoincrement=False, nullable=True),
    sa.Column('max_context', sa.INTEGER(), server_default=sa.text('1000'), autoincrement=False, nullable=True),
    sa.Column('λ_time', sa.DOUBLE_PRECISION(precision=53), server_default=sa.text('0.5'), autoincrement=False, nullable=True),
    sa.Column('λ_mem', sa.DOUBLE_PRECISION(precision=53), server_default=sa.text('0.5'), autoincrement=False, nullable=True),
    sa.Column('offset', sa.DOUBLE_PRECISION(precision=53), server_default=sa.text('0.0'), autoincrement=False, nullable=True),
    sa.Column('created_at', postgresql.TIMESTAMP(), server_default=sa.text('CURRENT_TIMESTAMP'), autoincrement=False, nullable=True),
    sa.Column('updated_at', postgresql.TIMESTAMP(), server_default=sa.text('CURRENT_TIMESTAMP'), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('config_id', name=op.f('data_config_pkey'))
    )
    # ### end Alembic commands ###
