Files
apskel-pos-backend/migrations/000086_make_ingredients_unit_id_nullable.up.sql

6 lines
327 B
SQL

-- An ingredient can be registered before its unit has been decided, so unit_id
-- is optional. Existing rows are untouched: they already have a unit.
ALTER TABLE ingredients ALTER COLUMN unit_id DROP NOT NULL;
COMMENT ON COLUMN ingredients.unit_id IS 'Base unit of the ingredient. NULL means no unit has been assigned yet.';