-- Migration: Move allow_update_discount from categories to products
-- Purpose: Control update discount eligibility on product level rather than category level.

ALTER TABLE public.categories DROP COLUMN IF EXISTS allow_update_discount;
ALTER TABLE public.products ADD COLUMN IF NOT EXISTS allow_update_discount BOOLEAN DEFAULT true NOT NULL;

NOTIFY pgrst, 'reload schema';
