-- ============================================
-- Convert Database to UTF8MB4 (for Emoji Support)
-- ============================================

-- Change database default charset
ALTER DATABASE `ameasy` CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;

-- Convert existing tables to UTF8MB4

-- Convert categories table
ALTER TABLE `categories` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- Convert products table
ALTER TABLE `products` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- Convert product_images table (if exists)
ALTER TABLE `product_images` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- Convert product_reviews table (if exists)
ALTER TABLE `product_reviews` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- Convert product_variants table (if exists)
ALTER TABLE `product_variants` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- Convert users table (if exists)
ALTER TABLE `users` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- Convert settings table (if exists)
ALTER TABLE `settings` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- ============================================
-- Done! Now emojis will work properly 😊
-- ============================================
