-- Halbserienbasierte Spielinteressen (pro Mitglied, Club, Saison und Halbserie)

CREATE TABLE IF NOT EXISTS `member_play_interest` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `club_id` INT NOT NULL,
  `member_id` INT NOT NULL,
  `season_id` INT NOT NULL,
  `lineup_half` ENUM('first_half', 'second_half') NOT NULL,
  `interested` TINYINT(1) NOT NULL DEFAULT 1,
  `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_member_play_interest_half` (`club_id`, `member_id`, `season_id`, `lineup_half`),
  KEY `idx_member_play_interest_member` (`member_id`),
  KEY `idx_member_play_interest_season` (`season_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
