5410 - Add paint price to prices_other_products (#395)

This commit is contained in:
Anders Gustafsson
2024-05-07 14:52:44 +02:00
committed by GitHub
parent 1eeeb515a0
commit b218d53389
+7
View File
@@ -0,0 +1,7 @@
ALTER TABLE prices_other_products DROP COLUMN IF EXISTS paint_price_per_liter;
-- Add new column to prices_other_products for paint price per litre (with made up prices)
ALTER TABLE prices_other_products ADD COLUMN paint_price_per_liter NUMERIC;
UPDATE prices_other_products SET paint_price_per_liter = wallpaper_kit_price; -- Set paint price per litre to the same as wallpaper kit price for now
ALTER TABLE prices_other_products ALTER COLUMN paint_price_per_liter SET NOT NULL;
ALTER TABLE prices_other_products ADD CONSTRAINT valid_paint_price_per_liter CHECK (prices_other_products.paint_price_per_liter > 0);