Fix: Upgrade failed when multiple skus
This commit is contained in:
@ -37,7 +37,9 @@ def upgrade():
|
|||||||
column("fraction_units", Unicode(255)),
|
column("fraction_units", Unicode(255)),
|
||||||
)
|
)
|
||||||
op.execute(
|
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")
|
op.drop_index("unique_true_is_default", table_name="stock_keeping_units")
|
||||||
|
|||||||
Reference in New Issue
Block a user