From f4f8f565e536ce1fca696c173f3c045d6754c0f1 Mon Sep 17 00:00:00 2001 From: Anders Gustafsson <34234789+anders-photowall@users.noreply.github.com> Date: Wed, 14 Aug 2024 11:21:59 +0200 Subject: [PATCH] 5806 add paint card sample to db (#409) --- migrations/000.489.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 migrations/000.489.sql diff --git a/migrations/000.489.sql b/migrations/000.489.sql new file mode 100644 index 0000000..3b7d29b --- /dev/null +++ b/migrations/000.489.sql @@ -0,0 +1,10 @@ +ALTER TABLE prices_other_products DROP COLUMN IF EXISTS paint_card_sample_price; + +-- Add new column to prices_other_products for paint card sample (with made up prices) +ALTER TABLE prices_other_products ADD COLUMN paint_card_sample_price NUMERIC; +UPDATE prices_other_products SET paint_card_sample_price = wallpaper_sample_price; -- Set paint card sample price to the same as wallpaper sample price for now +ALTER TABLE prices_other_products ALTER COLUMN paint_card_sample_price SET NOT NULL; +ALTER TABLE prices_other_products ADD CONSTRAINT valid_paint_card_sample_price CHECK (prices_other_products.paint_card_sample_price > 0); + +ALTER TYPE order_row_sub_type + ADD VALUE IF NOT EXISTS 'paint_card_sample';