-- Migration: Add allow_negative_stock column to businesses table
-- Description: Allows admin to configure whether users can sell products with insufficient stock

-- Add allow_negative_stock column to businesses table
ALTER TABLE businesses
ADD COLUMN allow_negative_stock TINYINT(1) DEFAULT 0 COMMENT 'Allow selling products with insufficient stock (negative stock tracking)';

-- Set default value for existing records
UPDATE businesses
SET allow_negative_stock = 0
WHERE allow_negative_stock IS NULL;
