Files
yourpart3/backend/sql/rebalance_product_certificates.sql

52 lines
1.3 KiB
PL/PgSQL

BEGIN;
UPDATE falukant_type.product
SET sell_cost = CASE label_tr
WHEN 'wheat' THEN 7
WHEN 'grain' THEN 7
WHEN 'carrot' THEN 4
WHEN 'fish' THEN 7
WHEN 'meat' THEN 7
WHEN 'leather' THEN 7
WHEN 'wood' THEN 7
WHEN 'stone' THEN 7
WHEN 'milk' THEN 5
WHEN 'cheese' THEN 5
WHEN 'bread' THEN 5
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;