From 7a5ccdfbbb21a0d6205dd6d087b7bb9a4b5ce2ea Mon Sep 17 00:00:00 2001 From: tanshu Date: Tue, 2 Nov 2021 14:15:00 +0530 Subject: [PATCH] Fix: Upgrade failed when multiple skus --- brewman/alembic/versions/c39eb451a683_fraction_units.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/brewman/alembic/versions/c39eb451a683_fraction_units.py b/brewman/alembic/versions/c39eb451a683_fraction_units.py index ae332994..7da3e192 100644 --- a/brewman/alembic/versions/c39eb451a683_fraction_units.py +++ b/brewman/alembic/versions/c39eb451a683_fraction_units.py @@ -37,7 +37,9 @@ def upgrade(): column("fraction_units", Unicode(255)), ) op.execute( - product.update().values(fraction_units=select(sku.c.fraction_units).where(sku.c.product_id == product.c.id)) + product.update().values( + fraction_units=select(sku.c.fraction_units).where(sku.c.product_id == product.c.id).limit(1) + ) ) op.drop_index("unique_true_is_default", table_name="stock_keeping_units")