-- Kapitano custom feature: guest cart phone number
-- Run manually. NOT part of the CMS updater version map.

CREATE TABLE `guest_cart_infos` (
  `id` int(11) NOT NULL,
  `temp_user_id` varchar(64) NOT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

ALTER TABLE `guest_cart_infos`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `guest_cart_infos_temp_user_id_unique` (`temp_user_id`);

ALTER TABLE `guest_cart_infos`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

COMMIT;
