refactor(backend): drop the legacy products.printer_zone_id and its print fallbacks

Routing has been by prep zone only since v1, which nulled this column on every start, so the four fallbacks in printer_service.py never ran. Revision 0012 drops the column (its unnamed FK goes with the batch rebuild). The unused legacy GET /api/kds/items keeps its single 'no zone' group. Product create/update/export/import no longer mention it. Scheduled in plan step 1.0 for the catalogue rework (1.13).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-13 12:28:13 +02:00
co-authored by Claude Opus 5.5
parent 82c6ca4e0a
commit 3c5751025c
8 changed files with 37 additions and 57 deletions
@@ -0,0 +1,35 @@
"""drop legacy products.printer_zone_id (plan step 1.13; noted in 1.0)
Hand-edited: the FK is unnamed, so it can't be dropped by name in SQLite batch mode; the
batch rebuild of `products` drops it together with the column. Routing has been by prep
zone only since v1 (v1 nulled this column on every start), so no data is lost.
Revision ID: 0012_drop_product_printer_zone
Revises: 0011_order_item_names
Create Date: 2026-11-13 12:27:34.824101
"""
from alembic import op
import sqlalchemy as sa
revision = '0012_drop_product_printer_zone'
down_revision = '0011_order_item_names'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('products', schema=None) as batch_op:
batch_op.drop_column('printer_zone_id')
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('products', schema=None) as batch_op:
batch_op.add_column(sa.Column('printer_zone_id', sa.INTEGER(), nullable=True))
batch_op.create_foreign_key('fk_products_printer_zone_id', 'printers', ['printer_zone_id'], ['id'])
# ### end Alembic commands ###