Migration 0005 makes print_jobs.printer_id nullable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
29 lines
706 B
Python
29 lines
706 B
Python
"""make print_jobs.printer_id nullable — printer is assigned at job start
|
|
|
|
Revision ID: 0005
|
|
Revises: 0004
|
|
Create Date: 2026-06-18
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
revision: str = "0005"
|
|
down_revision: Union[str, None] = "0004"
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.alter_column("print_jobs", "printer_id",
|
|
existing_type=sa.Integer(),
|
|
nullable=True)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.alter_column("print_jobs", "printer_id",
|
|
existing_type=sa.Integer(),
|
|
nullable=False)
|