CREATE TABLE IF NOT EXISTS stock_log (
    stock_log_id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    lot VARCHAR(255) NOT NULL,
    supplier VARCHAR(255) NULL,
    date DATE NOT NULL,
    price DECIMAL(12,2) NOT NULL,
    quality VARCHAR(255) NULL,
    comments TEXT NULL,
    vendor VARCHAR(255) NULL,
    qty DECIMAL(14,3) NULL,
    INDEX idx_stock_log_lot_date (lot, date),
    INDEX idx_stock_log_date (date),
    INDEX idx_stock_log_vendor (vendor)
);
