From b218d533897b5889b97749fd8f95dde5018e1b4b Mon Sep 17 00:00:00 2001 From: Anders Gustafsson <34234789+anders-photowall@users.noreply.github.com> Date: Tue, 7 May 2024 14:52:44 +0200 Subject: [PATCH] 5410 - Add paint price to prices_other_products (#395) --- migrations/000.476.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 migrations/000.476.sql diff --git a/migrations/000.476.sql b/migrations/000.476.sql new file mode 100644 index 0000000..92f28d6 --- /dev/null +++ b/migrations/000.476.sql @@ -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);