[add] migration script

This commit is contained in:
Mark
2025-12-20 15:27:47 +08:00
parent 1f4524c28c
commit 3f4c2d7796

View File

@@ -0,0 +1,38 @@
"""202512201526
Revision ID: 626abf154a6a
Revises: 70e94dd4a8d1
Create Date: 2025-12-20 15:26:50.634470
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '626abf154a6a'
down_revision: Union[str, None] = '70e94dd4a8d1'
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.add_column('data_config', sa.Column('emotion_enabled', sa.Boolean(), nullable=True, comment='是否启用情绪提取'))
op.add_column('data_config', sa.Column('emotion_model_id', sa.String(), nullable=True, comment='情绪分析专用模型ID'))
op.add_column('data_config', sa.Column('emotion_extract_keywords', sa.Boolean(), nullable=True, comment='是否提取情绪关键词'))
op.add_column('data_config', sa.Column('emotion_min_intensity', sa.Float(), nullable=True, comment='最小情绪强度阈值'))
op.add_column('data_config', sa.Column('emotion_enable_subject', sa.Boolean(), nullable=True, comment='是否启用主体分类'))
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('data_config', 'emotion_enable_subject')
op.drop_column('data_config', 'emotion_min_intensity')
op.drop_column('data_config', 'emotion_extract_keywords')
op.drop_column('data_config', 'emotion_model_id')
op.drop_column('data_config', 'emotion_enabled')
# ### end Alembic commands ###