-- Add premium-tier flags supporting the new cac-litespeed:phpNN container family.
--
-- Two columns, both default 0 so this migration is a no-op for behavior on
-- existing installs: container_types.is_premium gates a container type behind
-- a per-user allowance, and client_allowances.litespeed_enabled is the
-- per-user toggle (flipped by the WHMCS configoption in a follow-up).
--
-- Idempotent via ADD COLUMN IF NOT EXISTS (MariaDB supports this; matches
-- the pattern in 2026.04.10/add-eol-date-to-container-types.sql). Safe to
-- re-run on servers where these columns already exist.

USE whp;

ALTER TABLE container_types
ADD COLUMN IF NOT EXISTS is_premium TINYINT(1) NOT NULL DEFAULT 0
COMMENT 'When 1, this container type is hidden from the create-site dropdown unless the user has client_allowances.litespeed_enabled = 1 (or is root).'
AFTER active;

ALTER TABLE client_allowances
ADD COLUMN IF NOT EXISTS litespeed_enabled TINYINT(1) NOT NULL DEFAULT 0
COMMENT 'When 1, this user can select premium (LiteSpeed) container types. Flipped by the WHMCS litespeed_tier configoption.';
