-- Migration: openws -> admincitywebshop
-- Datum: 2026-06-10
-- Leiras: Strukturalis kulonbsegek migracioja a forras (openws) es cel (admincitywebshop) kozott

-- ============================================================
-- 1. UJ TABLA: azonics_user_events
--    (letezik a forrasban, hianyzik a celbol)
-- ============================================================

CREATE TABLE IF NOT EXISTS `azonics_user_events` (
  `event_id` int(11) NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) NOT NULL,
  `previous_uuid` varchar(255) DEFAULT NULL,
  `hotel` varchar(255) DEFAULT NULL,
  `order_id` varchar(255) DEFAULT NULL,
  `cart` text DEFAULT NULL,
  `event_type` varchar(100) NOT NULL,
  `event_name` varchar(255) NOT NULL,
  `event_data` text DEFAULT NULL,
  `page_url` varchar(500) DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` varchar(500) DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`event_id`),
  KEY `idx_uuid` (`uuid`),
  KEY `idx_created_at` (`created_at`),
  KEY `idx_event_type` (`event_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

-- ============================================================
-- 2. OSZLOPTIPUS-KULONBSEGEK
--    A cel (admincitywebshop) longtext-et hasznal ott, ahol a
--    forras (openws) varchar(255)-ot.
--    FIGYELEM: longtext -> varchar(255) adat-csonkulast okozhat!
--    Csak akkor futtasd, ha biztosan nincs 255 karakternel
--    hosszabb adat ezekben az oszlopokban.
-- ============================================================

-- 2a. azonics_boxes: box_subtitle, box_subtitle_en (longtext -> varchar(255))
-- ALTER TABLE `azonics_boxes` MODIFY `box_subtitle` varchar(255) NOT NULL DEFAULT ' ';
-- ALTER TABLE `azonics_boxes` MODIFY `box_subtitle_en` varchar(255) NOT NULL DEFAULT ' ';

-- 2b. azonics_menus: box_subtitle, box_subtitle_en, box_banner (longtext -> varchar(255))
-- ALTER TABLE `azonics_menus` MODIFY `box_subtitle` varchar(255) NOT NULL DEFAULT ' ';
-- ALTER TABLE `azonics_menus` MODIFY `box_subtitle_en` varchar(255) NOT NULL DEFAULT ' ';
-- ALTER TABLE `azonics_menus` MODIFY `box_banner` varchar(255) NOT NULL DEFAULT ' ';

-- 2c. azonics_packages: box_subtitle, box_subtitle_en (longtext -> varchar(255))
-- ALTER TABLE `azonics_packages` MODIFY `box_subtitle` varchar(255) NOT NULL DEFAULT ' ';
-- ALTER TABLE `azonics_packages` MODIFY `box_subtitle_en` varchar(255) NOT NULL DEFAULT ' ';
