-- Migration 0060 : Ajout option bloquer_stock_negatif sur options_commercial

IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'options_commercial')
   AND NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'options_commercial' AND COLUMN_NAME = 'bloquer_stock_negatif')
BEGIN
    EXEC('ALTER TABLE options_commercial ADD bloquer_stock_negatif BIT NOT NULL DEFAULT 0');
    PRINT 'Colonne bloquer_stock_negatif ajoutee a options_commercial';
END
ELSE
BEGIN
    PRINT 'Colonne deja presente ou table absente - migration ignoree';
END
