CREATE TABLE IF NOT EXISTS `team_updates` (
  `id` BIGINT AUTO_INCREMENT PRIMARY KEY,
  `action` ENUM('beitritt', 'kuendigung', 'uprank', 'derank') NOT NULL,
  `user_id` VARCHAR(32) NOT NULL,
  `user_name` VARCHAR(255) NOT NULL,
  `rolle` VARCHAR(32) NULL,
  `alter_rang` VARCHAR(32) NULL,
  `neuer_rang` VARCHAR(32) NULL,
  `grund` TEXT NULL,
  `executor_id` VARCHAR(32) NOT NULL,
  `executor_name` VARCHAR(255) NOT NULL,
  `timestamp` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  INDEX `idx_user_id` (`user_id`),
  INDEX `idx_timestamp` (`timestamp`),
  INDEX `idx_action` (`action`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
