31 lines
1014 B
Python
31 lines
1014 B
Python
|
|
"""add reasoning fields to purchase orders
|
||
|
|
|
||
|
|
Revision ID: 20251107_add_reasoning_fields
|
||
|
|
Revises: 20251030_0737_9450f58f3623
|
||
|
|
Create Date: 2025-11-07
|
||
|
|
|
||
|
|
"""
|
||
|
|
from alembic import op
|
||
|
|
import sqlalchemy as sa
|
||
|
|
from sqlalchemy.dialects import postgresql
|
||
|
|
|
||
|
|
# revision identifiers, used by Alembic.
|
||
|
|
revision = '20251107_add_reasoning_fields'
|
||
|
|
down_revision = '20251030_0737_9450f58f3623'
|
||
|
|
branch_labels = None
|
||
|
|
depends_on = None
|
||
|
|
|
||
|
|
|
||
|
|
def upgrade():
|
||
|
|
# Add reasoning fields to purchase_orders table
|
||
|
|
op.add_column('purchase_orders', sa.Column('reasoning', sa.Text(), nullable=True))
|
||
|
|
op.add_column('purchase_orders', sa.Column('consequence', sa.Text(), nullable=True))
|
||
|
|
op.add_column('purchase_orders', sa.Column('reasoning_data', postgresql.JSONB(astext_type=sa.Text()), nullable=True))
|
||
|
|
|
||
|
|
|
||
|
|
def downgrade():
|
||
|
|
# Remove reasoning fields from purchase_orders table
|
||
|
|
op.drop_column('purchase_orders', 'reasoning_data')
|
||
|
|
op.drop_column('purchase_orders', 'consequence')
|
||
|
|
op.drop_column('purchase_orders', 'reasoning')
|