优化
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
"""add batch_id to processing_tasks
|
||||
|
||||
批次 2(D7):批量元数据入库——processing_tasks 增加 batch_id 列,
|
||||
批量任务聚合查询走 PG,替代 Redis/进程内存中的批量元数据。
|
||||
|
||||
Revision ID: a3f8c2d91e47
|
||||
Revises: 006c18c51b0d
|
||||
Create Date: 2026-09-16
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'a3f8c2d91e47'
|
||||
down_revision: Union[str, Sequence[str], None] = '006c18c51b0d'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.add_column(
|
||||
'processing_tasks',
|
||||
sa.Column('batch_id', sa.String(length=36), nullable=True),
|
||||
)
|
||||
op.create_index(
|
||||
'ix_processing_tasks_batch_id',
|
||||
'processing_tasks',
|
||||
['batch_id'],
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_index('ix_processing_tasks_batch_id', table_name='processing_tasks')
|
||||
op.drop_column('processing_tasks', 'batch_id')
|
||||
Reference in New Issue
Block a user