-- Add EOL date tracking to container types for deprecation warnings
-- PHP versions past EOL will show warnings in the panel UI

USE whp;

ALTER TABLE container_types
ADD COLUMN IF NOT EXISTS eol_date DATE NULL DEFAULT NULL
COMMENT 'End of Life date for this container type. NULL means actively supported.'
AFTER active;

-- Set EOL dates for PHP versions that have reached end of life
-- Source: https://www.php.net/supported-versions.php
UPDATE container_types SET eol_date = '2022-11-28' WHERE name LIKE 'PHP%7.4%';
UPDATE container_types SET eol_date = '2023-11-26' WHERE name LIKE 'PHP%8.0%';
UPDATE container_types SET eol_date = '2025-12-31' WHERE name LIKE 'PHP%8.1%';
