-- Phase 4 only — non-runtime augmentation.
-- Confidence metadata is advisory and read-only at runtime.

-- LEGACY_READ
-- LEGACY TABLE WARNING:
-- product_fitment is deprecated and must not be used for
-- fitment evaluation, confidence scoring, or reconciliation.
-- Use fitment_resolved instead.
CREATE TABLE IF NOT EXISTS product_fitment_confidence (
    id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    product_id BIGINT UNSIGNED NOT NULL,
    make VARCHAR(64) NOT NULL DEFAULT '',
    model VARCHAR(128) NOT NULL DEFAULT '',
    model_year INT NOT NULL DEFAULT 0,
    confidence VARCHAR(32) NOT NULL DEFAULT '',
    source VARCHAR(64) NOT NULL DEFAULT '',
    created_at DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00',
    INDEX idx_confidence_product (product_id),
    INDEX idx_confidence_vehicle (make, model, model_year)
);
