ALTER TABLE preferences ADD COLUMN mtp_draft_tokens INTEGER NOT NULL DEFAULT 1
    CHECK (mtp_draft_tokens > 0);
ALTER TABLE preferences ADD COLUMN mtp_margin REAL NOT NULL DEFAULT 3
    CHECK (mtp_margin BETWEEN 0 AND 1000);
ALTER TABLE preferences ADD COLUMN glm_mtp BOOLEAN NOT NULL DEFAULT 0
    CHECK (glm_mtp IN (0, 1));
ALTER TABLE preferences ADD COLUMN glm_mtp_timing BOOLEAN NOT NULL DEFAULT 0
    CHECK (glm_mtp_timing IN (0, 1));
ALTER TABLE preferences ADD COLUMN dspark_confidence_threshold REAL
    CHECK (dspark_confidence_threshold IS NULL OR dspark_confidence_threshold BETWEEN 0 AND 1);
ALTER TABLE preferences ADD COLUMN dspark_strict BOOLEAN NOT NULL DEFAULT 0
    CHECK (dspark_strict IN (0, 1));

ALTER TABLE preferences ADD COLUMN ssd_streaming BOOLEAN NOT NULL DEFAULT 0
    CHECK (ssd_streaming IN (0, 1));
ALTER TABLE preferences ADD COLUMN ssd_streaming_cold BOOLEAN NOT NULL DEFAULT 0
    CHECK (ssd_streaming_cold IN (0, 1));
ALTER TABLE preferences ADD COLUMN ssd_cache_experts BIGINT
    CHECK (ssd_cache_experts IS NULL OR ssd_cache_experts > 0);
ALTER TABLE preferences ADD COLUMN ssd_cache_gib BIGINT
    CHECK (ssd_cache_gib IS NULL OR ssd_cache_gib > 0);
ALTER TABLE preferences ADD COLUMN ssd_full_layers INTEGER
    CHECK (ssd_full_layers IS NULL OR ssd_full_layers >= 0);
ALTER TABLE preferences ADD COLUMN ssd_preload_experts INTEGER
    CHECK (ssd_preload_experts IS NULL OR ssd_preload_experts > 0);

ALTER TABLE preferences ADD COLUMN directional_steering_file TEXT;
ALTER TABLE preferences ADD COLUMN directional_steering_ffn REAL
    CHECK (directional_steering_ffn IS NULL OR directional_steering_ffn BETWEEN -100 AND 100);
ALTER TABLE preferences ADD COLUMN directional_steering_attn REAL
    CHECK (directional_steering_attn IS NULL OR directional_steering_attn BETWEEN -100 AND 100);

ALTER TABLE preferences ADD COLUMN simulated_used_memory_gib BIGINT
    CHECK (simulated_used_memory_gib IS NULL OR simulated_used_memory_gib > 0);
ALTER TABLE preferences ADD COLUMN expert_profile_path TEXT;
