-- Seed the five LiteSpeed container_types rows for the cac-litespeed:phpNN
-- family (premium tier — OpenLiteSpeed + LSCache, native LSAPI).
--
-- These rows mirror the existing PHP rows in 2026.05.171/seed-base-container-types.sql
-- but with:
--   - base_image pointing at cac-litespeed:php8N
--   - min_memory bumped to 512 (LiteSpeed's RAM floor is slightly higher
--     than Apache+FPM at the same concurrency)
--   - is_premium = 1 (gated by client_allowances.litespeed_enabled — see
--     pages/sites.php dropdown filter)
--
-- INSERT IGNORE on the UNIQUE `name` column keeps this safe on re-run and on
-- servers where some/all rows already exist. The is_premium column must
-- exist before this migration runs — add-litespeed-tier-flags.sql ships in
-- the same staging batch and apply-scripts.sh applies SQL alphabetically,
-- so add-litespeed-tier-flags.sql sorts ahead of this file. (Same staging
-- discipline as 2026.05.171 — schema first, seed second.)

USE whp;

INSERT IGNORE INTO container_types
    (name, description, base_image, min_cpu, min_memory,
     startup_env, user_variables, mount_options, listen_port, listen_port_tls, active, is_premium)
VALUES
('LiteSpeed PHP 8.1', 'OpenLiteSpeed + LSCache, premium tier — PHP 8.1', 'repo.anhonesthost.net/cloud-hosting-platform/cac-litespeed:php81', 0.25, 512,
 '{"uid": "${WHP_UID}", "user": "${WHP_USER}", "domain": "${WHP_DOMAIN}"}',
 '{}',
 '{"volumes": [{"source": "${WHP_HOME}/${WHP_DOMAIN}", "target": "/home/${WHP_USER}", "type": "bind"}]}',
 443, 1, 1, 1),

('LiteSpeed PHP 8.2', 'OpenLiteSpeed + LSCache, premium tier — PHP 8.2', 'repo.anhonesthost.net/cloud-hosting-platform/cac-litespeed:php82', 0.25, 512,
 '{"uid": "${WHP_UID}", "user": "${WHP_USER}", "domain": "${WHP_DOMAIN}"}',
 '{}',
 '{"volumes": [{"source": "${WHP_HOME}/${WHP_DOMAIN}", "target": "/home/${WHP_USER}", "type": "bind"}]}',
 443, 1, 1, 1),

('LiteSpeed PHP 8.3', 'OpenLiteSpeed + LSCache, premium tier — PHP 8.3', 'repo.anhonesthost.net/cloud-hosting-platform/cac-litespeed:php83', 0.25, 512,
 '{"uid": "${WHP_UID}", "user": "${WHP_USER}", "domain": "${WHP_DOMAIN}"}',
 '{}',
 '{"volumes": [{"source": "${WHP_HOME}/${WHP_DOMAIN}", "target": "/home/${WHP_USER}", "type": "bind"}]}',
 443, 1, 1, 1),

('LiteSpeed PHP 8.4', 'OpenLiteSpeed + LSCache, premium tier — PHP 8.4', 'repo.anhonesthost.net/cloud-hosting-platform/cac-litespeed:php84', 0.25, 512,
 '{"uid": "${WHP_UID}", "user": "${WHP_USER}", "domain": "${WHP_DOMAIN}"}',
 '{}',
 '{"volumes": [{"source": "${WHP_HOME}/${WHP_DOMAIN}", "target": "/home/${WHP_USER}", "type": "bind"}]}',
 443, 1, 1, 1),

('LiteSpeed PHP 8.5', 'OpenLiteSpeed + LSCache, premium tier — PHP 8.5', 'repo.anhonesthost.net/cloud-hosting-platform/cac-litespeed:php85', 0.25, 512,
 '{"uid": "${WHP_UID}", "user": "${WHP_USER}", "domain": "${WHP_DOMAIN}"}',
 '{}',
 '{"volumes": [{"source": "${WHP_HOME}/${WHP_DOMAIN}", "target": "/home/${WHP_USER}", "type": "bind"}]}',
 443, 1, 1, 1);
