Files
PayrollManagementSystem/backend/alembic/versions/21f2a3b4c5d6_automation_phase_default.py
T

17 lines
564 B
Python
Raw Normal View History

"""修正进程状态默认值的多余引号,保留已应用V20。"""
from alembic import op
revision: str = "21f2a3b4c5d6"
down_revision: str | None = "20e1f2a3b4c5"
branch_labels = None
depends_on = None
def upgrade():
op.execute("ALTER TABLE tplus_automation_states ALTER COLUMN worker_phase SET DEFAULT 'STOPPED'")
op.execute("UPDATE tplus_automation_states SET worker_phase='STOPPED' WHERE worker_phase='''STOPPED'''")
def downgrade():
op.execute("ALTER TABLE tplus_automation_states ALTER COLUMN worker_phase SET DEFAULT '''STOPPED'''")