SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;

USE hyapp_user;

SET @now_ms = CAST(UNIX_TIMESTAMP(UTC_TIMESTAMP(3)) * 1000 AS UNSIGNED);

-- App 注册表是 gateway 包名解析的事实来源；Huwaa 使用独立 app_code 隔离用户、钱包、房间和统计数据。
INSERT INTO apps (app_code, app_name, package_name, platform, status, created_at_ms, updated_at_ms)
VALUES ('huwaa', 'Huwaa', 'com.app.huwaa', '', 'active', @now_ms, @now_ms)
ON DUPLICATE KEY UPDATE
  app_name = VALUES(app_name),
  package_name = VALUES(package_name),
  platform = VALUES(platform),
  status = VALUES(status),
  updated_at_ms = VALUES(updated_at_ms);
