CREATE TABLE IF NOT EXISTS baishun_provider_config (
  id BIGINT NOT NULL PRIMARY KEY,
  sys_origin VARCHAR(32) NOT NULL,
  profile VARCHAR(32) NOT NULL DEFAULT 'PROD',
  active TINYINT(1) NOT NULL DEFAULT 1,
  platform_base_url VARCHAR(1024) NOT NULL,
  app_id BIGINT NOT NULL,
  app_name VARCHAR(128) DEFAULT NULL,
  app_channel VARCHAR(64) NOT NULL,
  app_key VARCHAR(255) NOT NULL,
  gsp INT NOT NULL DEFAULT 101,
  launch_code_ttl_seconds INT NOT NULL DEFAULT 300,
  ss_token_ttl_seconds INT NOT NULL DEFAULT 86400,
  create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  UNIQUE KEY uk_baishun_provider_sys_origin_profile (sys_origin, profile),
  KEY idx_baishun_provider_app (app_id, app_channel),
  KEY idx_baishun_provider_active (sys_origin, active, update_time)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
