CREATE TABLE `webhook_raw_logs` (
  `id` bigint(20) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `headers` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`headers`)),
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`payload`)),
  `store_id` varchar(10) NOT NULL,
  `receipt_id` varchar(100) NOT NULL,
  `received_at` timestamp NOT NULL DEFAULT current_timestamp(),
  UNIQUE KEY `webhook_raw_logs_store_id_receipt_id_unique` (`store_id`,`receipt_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
