Files
database/migrations/archive/000.476.sql
T
Rikard BartholfandGitHub ddcbd0afb0 Archive old migrations (#426)
* Archive old migrations

* Fix invalid placement of migrations
2024-10-17 11:19:12 +02:00

8 lines
614 B
SQL

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);