-- Add key_type column for compatibility (fixes "no such column: key_type" on login).
-- key_type is a generated column mirroring config_key. scripts/mysql_migrate.py runs this idempotently
-- and also adds key_type to ftt_app_admin_config when that table exists.
ALTER TABLE app_admin_config ADD COLUMN key_type VARCHAR(64) GENERATED ALWAYS AS (config_key) STORED;
