Spaces:
Sleeping
Sleeping
axeronis commited on
Commit ·
2ae41f6
1
Parent(s): c87b355
Add migration for escalation fields (needs_attention, escalation_reason, escalation_at)
Browse files
backend/alembic/versions/2025_12_24_escalation_fields.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Add escalation fields to leads
|
| 2 |
+
|
| 3 |
+
Revision ID: 2025_12_24_escalation_fields
|
| 4 |
+
Revises: 2025_12_23_voice_settings
|
| 5 |
+
Create Date: 2025-12-24
|
| 6 |
+
|
| 7 |
+
"""
|
| 8 |
+
from alembic import op
|
| 9 |
+
import sqlalchemy as sa
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
# revision identifiers, used by Alembic.
|
| 13 |
+
revision = '2025_12_24_escalation_fields'
|
| 14 |
+
down_revision = '2025_12_23_voice_settings'
|
| 15 |
+
branch_labels = None
|
| 16 |
+
depends_on = None
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
def upgrade():
|
| 20 |
+
# Add escalation fields to leads table
|
| 21 |
+
op.add_column('leads', sa.Column('needs_attention', sa.Boolean(), nullable=True, server_default='false'))
|
| 22 |
+
op.add_column('leads', sa.Column('escalation_reason', sa.String(50), nullable=True))
|
| 23 |
+
op.add_column('leads', sa.Column('escalation_at', sa.DateTime(), nullable=True))
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def downgrade():
|
| 27 |
+
op.drop_column('leads', 'escalation_at')
|
| 28 |
+
op.drop_column('leads', 'escalation_reason')
|
| 29 |
+
op.drop_column('leads', 'needs_attention')
|