-- Phase 4 only — non-runtime augmentation.
-- Exclusions are advisory metadata and never change fitment outcomes.

-- 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_exclusions (
    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 '',
    year_from INT NOT NULL DEFAULT 0,
    year_to INT NOT NULL DEFAULT 0,
    reason VARCHAR(255) NOT NULL DEFAULT '',
    created_by VARCHAR(80) NOT NULL DEFAULT '',
    created_at DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00',
    INDEX idx_exclusions_product (product_id),
    INDEX idx_exclusions_vehicle (make, model, year_from, year_to)
);
