CREATE TABLE IF NOT EXISTS `daybook_readings` (
  `id` INT AUTO_INCREMENT PRIMARY KEY,
  `date` DATE NOT NULL,
  `nozzle_id` INT NOT NULL,
  `opening_reading` DECIMAL(10, 2) NOT NULL,
  `closing_reading` DECIMAL(10, 2) NOT NULL,
  `price` DECIMAL(10, 2) NOT NULL,
  `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  FOREIGN KEY (`nozzle_id`) REFERENCES `nozzles`(`id`),
  UNIQUE KEY `date_nozzle` (`date`, `nozzle_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
