Make printer optional on job creation — assigned when job starts
Migration 0005 makes print_jobs.printer_id nullable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
28
alembic/versions/0005_nullable_printer_id.py
Normal file
28
alembic/versions/0005_nullable_printer_id.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""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)
|
||||
Reference in New Issue
Block a user