Improve the frontend and fix TODOs
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
"""Add waste_defect_type and is_ai_assisted to production_batches
|
||||
|
||||
Revision ID: 7f8e9d2a1b3c
|
||||
Revises: 42a9c1fd8fec
|
||||
Create Date: 2025-10-23 09:00:00.000000
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '7f8e9d2a1b3c'
|
||||
down_revision = '42a9c1fd8fec'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
"""Add waste_defect_type and is_ai_assisted columns to production_batches table"""
|
||||
|
||||
# Add waste_defect_type column
|
||||
op.add_column(
|
||||
'production_batches',
|
||||
sa.Column('waste_defect_type', sa.String(length=100), nullable=True)
|
||||
)
|
||||
|
||||
# Add is_ai_assisted column with default False
|
||||
op.add_column(
|
||||
'production_batches',
|
||||
sa.Column('is_ai_assisted', sa.Boolean(), nullable=False, server_default='false')
|
||||
)
|
||||
|
||||
# Add index on is_ai_assisted for faster queries on AI-assisted batch filtering
|
||||
op.create_index(
|
||||
'ix_production_batches_is_ai_assisted',
|
||||
'production_batches',
|
||||
['is_ai_assisted'],
|
||||
unique=False
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Remove waste_defect_type and is_ai_assisted columns from production_batches table"""
|
||||
|
||||
# Drop index first
|
||||
op.drop_index('ix_production_batches_is_ai_assisted', table_name='production_batches')
|
||||
|
||||
# Drop columns
|
||||
op.drop_column('production_batches', 'is_ai_assisted')
|
||||
op.drop_column('production_batches', 'waste_defect_type')
|
||||
Reference in New Issue
Block a user