kivitendo/sql/Pg-upgrade2/warehouse2.sql @ f2cdceb9
c4563766 | Moritz Bunkus | -- @tag: warehouse2
|
|
-- @description: Defaultwert f?r onhand
|
|||
-- @depends: warehouse
|
|||
UPDATE parts SET onhand = COALESCE((SELECT SUM(qty) FROM inventory WHERE inventory.parts_id = parts.id), 0);
|
|||
ALTER TABLE parts ALTER COLUMN onhand SET DEFAULT 0;
|