-- Run once to change purchase status to Ordered, Pending, Received, Cancelled.
-- Ingredients are added to stock only when status is set to Received.
USE cmr_ecommerce;
UPDATE purchases SET status = 'RECEIVED' WHERE status = 'COMPLETED';
UPDATE purchases SET status = 'ORDERED' WHERE status = 'DRAFT';
ALTER TABLE purchases MODIFY status ENUM('ORDERED','PENDING','RECEIVED','CANCELLED') NOT NULL DEFAULT 'ORDERED';
