-- Migration: add use_sat / use_sun flags to llx_planning_ws_config
-- use_sat = 1  → Saturday is a working day for this machine (capacity = hrs_sat)
-- use_sat = 0  → Saturday is OFF for this machine (capacity forced to 0, regardless of hrs_sat)
-- Same logic for use_sun / Sunday.
-- Run once manually or via module upgrade.

SET NAMES utf8mb4;

ALTER TABLE llx_planning_ws_config
    ADD COLUMN IF NOT EXISTS use_sat TINYINT(1) NOT NULL DEFAULT 1 COMMENT '1=Saturday enabled, 0=disabled (overrides hrs_sat)' AFTER hrs_sat,
    ADD COLUMN IF NOT EXISTS use_sun TINYINT(1) NOT NULL DEFAULT 1 COMMENT '1=Sunday enabled,   0=disabled (overrides hrs_sun)' AFTER hrs_sun;
