Schema for 'inventory' table

CREATE TABLE `inventory` ( `id` int NOT NULL AUTO_INCREMENT, `product_id` int NOT NULL, `location_id` int NOT NULL, `quantity` int NOT NULL DEFAULT '0', `expiration_date` date DEFAULT NULL, `last_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `idx_inventory_item` (`product_id`,`location_id`,`expiration_date`), KEY `location_id` (`location_id`), CONSTRAINT `inventory_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE, CONSTRAINT `inventory_ibfk_2` FOREIGN KEY (`location_id`) REFERENCES `locations` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=7904 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci