CREATE TABLE IF NOT EXISTS admin_app_versions (
  id BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
  app_code VARCHAR(32) NOT NULL DEFAULT 'lalu',
  platform VARCHAR(24) NOT NULL,
  version VARCHAR(40) NOT NULL,
  build_number BIGINT NOT NULL,
  force_update BOOLEAN NOT NULL DEFAULT FALSE,
  download_url VARCHAR(2048) NOT NULL,
  description TEXT NULL,
  created_at_ms BIGINT NOT NULL,
  updated_at_ms BIGINT NOT NULL,
  UNIQUE KEY uk_admin_app_versions_build (app_code, platform, build_number),
  INDEX idx_admin_app_versions_latest (app_code, platform, build_number, id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
