CREATE TABLE IF NOT EXISTS `work_order_parts` (
  `id` INT AUTO_INCREMENT PRIMARY KEY,
  `work_order_id` INT NOT NULL,
  `inventory_id` INT NOT NULL,
  `quantity_used` INT NOT NULL DEFAULT 1,
  `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  FOREIGN KEY (`work_order_id`) REFERENCES `work_orders`(`id`) ON DELETE CASCADE,
  FOREIGN KEY (`inventory_id`) REFERENCES `inventory`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB;