-- 0015_wash_photos.sql (MySQL) — 洗车对比照（before / after / detail）
CREATE TABLE IF NOT EXISTS wash_photos (
    id            INT AUTO_INCREMENT PRIMARY KEY,
    wash_id       INT             NOT NULL,
    photo_type    VARCHAR(20)     NOT NULL DEFAULT 'detail',  -- before / after / detail / scene
    file_path     VARCHAR(500)    NOT NULL,
    file_name     VARCHAR(255)    NOT NULL,
    mime_type     VARCHAR(50)     DEFAULT NULL,
    file_size     INT             DEFAULT NULL,
    width         INT             DEFAULT NULL,
    height        INT             DEFAULT NULL,
    caption       VARCHAR(255)    DEFAULT NULL,
    sort_order    INT             NOT NULL DEFAULT 0,
    created_at    DATETIME        NOT NULL DEFAULT CURRENT_TIMESTAMP,
    is_deleted    TINYINT(1)      NOT NULL DEFAULT 0,
    INDEX idx_wash_photos_wash        (wash_id, is_deleted),
    INDEX idx_wash_photos_type        (photo_type),
    INDEX idx_wash_photos_created     (created_at DESC)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
