Files
yourpart3/backend/sql/rebalance_product_certificates.sql
Torsten Schulz (local) 1ab9407e79
All checks were successful
Deploy to production / deploy (push) Successful in 2m56s
Refactor code structure for improved readability and maintainability; optimize performance across multiple modules.
2026-07-21 09:08:15 +02:00

52 lines
1.3 KiB
PL/PgSQL
Executable File

BEGIN;
UPDATE falukant_type.product
SET sell_cost = CASE label_tr
WHEN 'wheat' THEN 11
WHEN 'grain' THEN 11
WHEN 'carrot' THEN 11
WHEN 'fish' THEN 11
WHEN 'meat' THEN 11
WHEN 'leather' THEN 11
WHEN 'wood' THEN 11
WHEN 'stone' THEN 11
WHEN 'milk' THEN 11
WHEN 'cheese' THEN 11
WHEN 'bread' THEN 11
WHEN 'beer' THEN 22
WHEN 'iron' THEN 24
WHEN 'copper' THEN 24
WHEN 'spices' THEN 42
WHEN 'salt' THEN 24
WHEN 'sugar' THEN 24
WHEN 'vinegar' THEN 24
WHEN 'cotton' THEN 24
WHEN 'wine' THEN 24
WHEN 'gold' THEN 40
WHEN 'diamond' THEN 40
WHEN 'furniture' THEN 40
WHEN 'clothing' THEN 40
WHEN 'jewelry' THEN 58
WHEN 'painting' THEN 58
WHEN 'book' THEN 58
WHEN 'weapon' THEN 58
WHEN 'armor' THEN 58
WHEN 'shield' THEN 58
WHEN 'horse' THEN 78
WHEN 'ox' THEN 78
ELSE sell_cost
END,
production_time = CASE label_tr
WHEN 'carrot' THEN 2
ELSE production_time
END
WHERE label_tr IN (
'wheat', 'grain', 'carrot', 'fish', 'meat', 'leather', 'wood', 'stone',
'milk', 'cheese', 'bread', 'beer', 'iron', 'copper', 'spices', 'salt',
'sugar', 'vinegar', 'cotton', 'wine', 'gold', 'diamond', 'furniture',
'clothing', 'jewelry', 'painting', 'book', 'weapon', 'armor', 'shield',
'horse', 'ox'
);
COMMIT;