
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `app_settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `app_settings_key_unique` (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `app_settings` WRITE;
/*!40000 ALTER TABLE `app_settings` DISABLE KEYS */;
/*!40000 ALTER TABLE `app_settings` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `awards` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `tournament_id` bigint unsigned NOT NULL,
  `team_id` bigint unsigned DEFAULT NULL,
  `player_id` bigint unsigned DEFAULT NULL,
  `category` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `awarded_at` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `awards_tournament_id_foreign` (`tournament_id`),
  KEY `awards_team_id_foreign` (`team_id`),
  KEY `awards_player_id_foreign` (`player_id`),
  KEY `awards_category_index` (`category`),
  CONSTRAINT `awards_player_id_foreign` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE SET NULL,
  CONSTRAINT `awards_team_id_foreign` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE SET NULL,
  CONSTRAINT `awards_tournament_id_foreign` FOREIGN KEY (`tournament_id`) REFERENCES `tournaments` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `awards` WRITE;
/*!40000 ALTER TABLE `awards` DISABLE KEYS */;
/*!40000 ALTER TABLE `awards` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `cache` (
  `key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `expiration` int NOT NULL,
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `cache` WRITE;
/*!40000 ALTER TABLE `cache` DISABLE KEYS */;
/*!40000 ALTER TABLE `cache` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `cache_locks` (
  `key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `owner` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `expiration` int NOT NULL,
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `cache_locks` WRITE;
/*!40000 ALTER TABLE `cache_locks` DISABLE KEYS */;
/*!40000 ALTER TABLE `cache_locks` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `committee_members` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `tournament_id` bigint unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `role_title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `division` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Panitia Pelaksana',
  `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `responsibility` text COLLATE utf8mb4_unicode_ci,
  `sort_order` smallint unsigned NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `parent_id` bigint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `committee_members_tournament_id_user_id_unique` (`tournament_id`,`user_id`),
  KEY `committee_members_division_index` (`division`),
  KEY `committee_members_user_id_foreign` (`user_id`),
  KEY `committee_members_parent_id_foreign` (`parent_id`),
  CONSTRAINT `committee_members_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `committee_members` (`id`) ON DELETE SET NULL,
  CONSTRAINT `committee_members_tournament_id_foreign` FOREIGN KEY (`tournament_id`) REFERENCES `tournaments` (`id`) ON DELETE CASCADE,
  CONSTRAINT `committee_members_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `committee_members` WRITE;
/*!40000 ALTER TABLE `committee_members` DISABLE KEYS */;
/*!40000 ALTER TABLE `committee_members` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `match_events` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `match_id` bigint unsigned NOT NULL,
  `team_id` bigint unsigned NOT NULL,
  `player_id` bigint unsigned DEFAULT NULL,
  `assist_player_id` bigint unsigned DEFAULT NULL,
  `replacement_player_id` bigint unsigned DEFAULT NULL,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `minute` tinyint unsigned NOT NULL,
  `extra_minute` tinyint unsigned DEFAULT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `lineup_applied` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `match_events_match_id_foreign` (`match_id`),
  KEY `match_events_team_id_foreign` (`team_id`),
  KEY `match_events_player_id_foreign` (`player_id`),
  KEY `match_events_assist_player_id_foreign` (`assist_player_id`),
  KEY `match_events_replacement_player_id_foreign` (`replacement_player_id`),
  KEY `match_events_type_index` (`type`),
  CONSTRAINT `match_events_assist_player_id_foreign` FOREIGN KEY (`assist_player_id`) REFERENCES `players` (`id`) ON DELETE SET NULL,
  CONSTRAINT `match_events_match_id_foreign` FOREIGN KEY (`match_id`) REFERENCES `matches` (`id`) ON DELETE CASCADE,
  CONSTRAINT `match_events_player_id_foreign` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE SET NULL,
  CONSTRAINT `match_events_replacement_player_id_foreign` FOREIGN KEY (`replacement_player_id`) REFERENCES `players` (`id`) ON DELETE SET NULL,
  CONSTRAINT `match_events_team_id_foreign` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `match_events` WRITE;
/*!40000 ALTER TABLE `match_events` DISABLE KEYS */;
/*!40000 ALTER TABLE `match_events` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `match_lineup_players` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `match_lineup_id` bigint unsigned NOT NULL,
  `player_id` bigint unsigned NOT NULL,
  `slot_code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `position_label` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `role` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'starter',
  `field_x` tinyint unsigned DEFAULT NULL,
  `field_y` tinyint unsigned DEFAULT NULL,
  `sort_order` tinyint unsigned NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `match_lineup_players_match_lineup_id_player_id_unique` (`match_lineup_id`,`player_id`),
  UNIQUE KEY `match_lineup_players_match_lineup_id_slot_code_unique` (`match_lineup_id`,`slot_code`),
  KEY `match_lineup_players_player_id_foreign` (`player_id`),
  KEY `match_lineup_players_role_index` (`role`),
  CONSTRAINT `match_lineup_players_match_lineup_id_foreign` FOREIGN KEY (`match_lineup_id`) REFERENCES `match_lineups` (`id`) ON DELETE CASCADE,
  CONSTRAINT `match_lineup_players_player_id_foreign` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `match_lineup_players` WRITE;
/*!40000 ALTER TABLE `match_lineup_players` DISABLE KEYS */;
/*!40000 ALTER TABLE `match_lineup_players` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `match_lineups` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `match_id` bigint unsigned NOT NULL,
  `team_id` bigint unsigned NOT NULL,
  `captain_player_id` bigint unsigned DEFAULT NULL,
  `penalty_taker_id` bigint unsigned DEFAULT NULL,
  `free_kick_taker_id` bigint unsigned DEFAULT NULL,
  `corner_taker_id` bigint unsigned DEFAULT NULL,
  `formation_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '4-3-3',
  `tactical_style` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'balanced',
  `instructions` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `match_lineups_match_id_team_id_unique` (`match_id`,`team_id`),
  KEY `match_lineups_team_id_foreign` (`team_id`),
  KEY `match_lineups_captain_player_id_foreign` (`captain_player_id`),
  KEY `match_lineups_penalty_taker_id_foreign` (`penalty_taker_id`),
  KEY `match_lineups_free_kick_taker_id_foreign` (`free_kick_taker_id`),
  KEY `match_lineups_corner_taker_id_foreign` (`corner_taker_id`),
  CONSTRAINT `match_lineups_captain_player_id_foreign` FOREIGN KEY (`captain_player_id`) REFERENCES `players` (`id`) ON DELETE SET NULL,
  CONSTRAINT `match_lineups_corner_taker_id_foreign` FOREIGN KEY (`corner_taker_id`) REFERENCES `players` (`id`) ON DELETE SET NULL,
  CONSTRAINT `match_lineups_free_kick_taker_id_foreign` FOREIGN KEY (`free_kick_taker_id`) REFERENCES `players` (`id`) ON DELETE SET NULL,
  CONSTRAINT `match_lineups_match_id_foreign` FOREIGN KEY (`match_id`) REFERENCES `matches` (`id`) ON DELETE CASCADE,
  CONSTRAINT `match_lineups_penalty_taker_id_foreign` FOREIGN KEY (`penalty_taker_id`) REFERENCES `players` (`id`) ON DELETE SET NULL,
  CONSTRAINT `match_lineups_team_id_foreign` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `match_lineups` WRITE;
/*!40000 ALTER TABLE `match_lineups` DISABLE KEYS */;
/*!40000 ALTER TABLE `match_lineups` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `match_rules` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `tournament_id` bigint unsigned NOT NULL,
  `rule_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'general',
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `sort_order` smallint unsigned NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `match_rules_tournament_id_foreign` (`tournament_id`),
  KEY `match_rules_rule_type_index` (`rule_type`),
  CONSTRAINT `match_rules_tournament_id_foreign` FOREIGN KEY (`tournament_id`) REFERENCES `tournaments` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `match_rules` WRITE;
/*!40000 ALTER TABLE `match_rules` DISABLE KEYS */;
/*!40000 ALTER TABLE `match_rules` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `match_substitution_requests` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `match_id` bigint unsigned NOT NULL,
  `team_id` bigint unsigned NOT NULL,
  `requested_by_user_id` bigint unsigned NOT NULL,
  `confirmed_by_user_id` bigint unsigned DEFAULT NULL,
  `player_out_id` bigint unsigned NOT NULL,
  `player_in_id` bigint unsigned NOT NULL,
  `minute` tinyint unsigned DEFAULT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
  `note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `confirmed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `match_event_id` bigint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `match_substitution_requests_match_id_foreign` (`match_id`),
  KEY `match_substitution_requests_team_id_foreign` (`team_id`),
  KEY `match_substitution_requests_requested_by_user_id_foreign` (`requested_by_user_id`),
  KEY `match_substitution_requests_confirmed_by_user_id_foreign` (`confirmed_by_user_id`),
  KEY `match_substitution_requests_player_out_id_foreign` (`player_out_id`),
  KEY `match_substitution_requests_player_in_id_foreign` (`player_in_id`),
  KEY `match_substitution_requests_status_index` (`status`),
  KEY `match_substitution_requests_match_event_id_foreign` (`match_event_id`),
  CONSTRAINT `match_substitution_requests_confirmed_by_user_id_foreign` FOREIGN KEY (`confirmed_by_user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `match_substitution_requests_match_event_id_foreign` FOREIGN KEY (`match_event_id`) REFERENCES `match_events` (`id`) ON DELETE SET NULL,
  CONSTRAINT `match_substitution_requests_match_id_foreign` FOREIGN KEY (`match_id`) REFERENCES `matches` (`id`) ON DELETE CASCADE,
  CONSTRAINT `match_substitution_requests_player_in_id_foreign` FOREIGN KEY (`player_in_id`) REFERENCES `players` (`id`) ON DELETE CASCADE,
  CONSTRAINT `match_substitution_requests_player_out_id_foreign` FOREIGN KEY (`player_out_id`) REFERENCES `players` (`id`) ON DELETE CASCADE,
  CONSTRAINT `match_substitution_requests_requested_by_user_id_foreign` FOREIGN KEY (`requested_by_user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `match_substitution_requests_team_id_foreign` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `match_substitution_requests` WRITE;
/*!40000 ALTER TABLE `match_substitution_requests` DISABLE KEYS */;
/*!40000 ALTER TABLE `match_substitution_requests` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `matches` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `tournament_id` bigint unsigned NOT NULL,
  `venue_id` bigint unsigned DEFAULT NULL,
  `home_team_id` bigint unsigned DEFAULT NULL,
  `away_team_id` bigint unsigned DEFAULT NULL,
  `matchday` smallint unsigned NOT NULL DEFAULT '1',
  `stage` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'league',
  `group_name` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bracket_round` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bracket_position` smallint unsigned DEFAULT NULL,
  `bracket_layout` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `round_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `kickoff_at` datetime DEFAULT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'scheduled',
  `home_score` tinyint unsigned NOT NULL DEFAULT '0',
  `away_score` tinyint unsigned NOT NULL DEFAULT '0',
  `referee_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `poster_background_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `poster_layout` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'classic',
  `poster_title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `poster_subtitle` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `poster_badge_text` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `poster_footer_text` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `poster_accent_color` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#fef08a',
  `poster_text_color` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#ffffff',
  `poster_font_family` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Inter, ui-sans-serif, system-ui, sans-serif',
  `poster_text_positions` json DEFAULT NULL,
  `poster_overlay_opacity` tinyint unsigned NOT NULL DEFAULT '76',
  `poster_show_score` tinyint(1) NOT NULL DEFAULT '1',
  `poster_show_venue` tinyint(1) NOT NULL DEFAULT '1',
  `poster_show_referee` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `round_number` smallint unsigned DEFAULT NULL,
  `home_source_match_id` bigint unsigned DEFAULT NULL,
  `away_source_match_id` bigint unsigned DEFAULT NULL,
  `winner_team_id` bigint unsigned DEFAULT NULL,
  `home_penalties` tinyint unsigned DEFAULT NULL,
  `away_penalties` tinyint unsigned DEFAULT NULL,
  `is_bye` tinyint(1) NOT NULL DEFAULT '0',
  `started_at` datetime DEFAULT NULL,
  `finished_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `matches_venue_id_foreign` (`venue_id`),
  KEY `matches_home_team_id_foreign` (`home_team_id`),
  KEY `matches_away_team_id_foreign` (`away_team_id`),
  KEY `matches_tournament_id_matchday_index` (`tournament_id`,`matchday`),
  KEY `matches_matchday_index` (`matchday`),
  KEY `matches_kickoff_at_index` (`kickoff_at`),
  KEY `matches_status_index` (`status`),
  KEY `matches_stage_index` (`stage`),
  KEY `matches_group_name_index` (`group_name`),
  KEY `matches_bracket_round_index` (`bracket_round`),
  KEY `matches_home_source_match_id_foreign` (`home_source_match_id`),
  KEY `matches_away_source_match_id_foreign` (`away_source_match_id`),
  KEY `matches_winner_team_id_foreign` (`winner_team_id`),
  KEY `matches_round_number_index` (`round_number`),
  CONSTRAINT `matches_away_source_match_id_foreign` FOREIGN KEY (`away_source_match_id`) REFERENCES `matches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `matches_away_team_id_foreign` FOREIGN KEY (`away_team_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE,
  CONSTRAINT `matches_home_source_match_id_foreign` FOREIGN KEY (`home_source_match_id`) REFERENCES `matches` (`id`) ON DELETE SET NULL,
  CONSTRAINT `matches_home_team_id_foreign` FOREIGN KEY (`home_team_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE,
  CONSTRAINT `matches_tournament_id_foreign` FOREIGN KEY (`tournament_id`) REFERENCES `tournaments` (`id`) ON DELETE CASCADE,
  CONSTRAINT `matches_venue_id_foreign` FOREIGN KEY (`venue_id`) REFERENCES `venues` (`id`) ON DELETE SET NULL,
  CONSTRAINT `matches_winner_team_id_foreign` FOREIGN KEY (`winner_team_id`) REFERENCES `teams` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `matches` WRITE;
/*!40000 ALTER TABLE `matches` DISABLE KEYS */;
/*!40000 ALTER TABLE `matches` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `migrations` WRITE;
/*!40000 ALTER TABLE `migrations` DISABLE KEYS */;
INSERT INTO `migrations` VALUES (1,'0001_01_01_000000_create_users_table',1),(2,'2026_09_28_000001_create_teams_table',1),(3,'2026_09_28_000002_create_players_table',1),(4,'2026_09_28_000003_create_venues_table',1),(5,'2026_09_28_000004_create_tournaments_table',1),(6,'2026_09_28_000005_create_matches_table',1),(7,'2026_09_28_000006_create_match_events_table',1),(8,'2026_09_28_000007_create_awards_table',1),(9,'2026_09_28_000008_create_cache_table',1),(10,'2026_09_28_000009_add_team_foreign_to_users_table',1),(11,'2026_09_28_000010_create_match_lineups_table',1),(12,'2026_09_28_000011_create_rules_and_committees_tables',1),(13,'2026_09_28_000012_create_match_substitution_requests_table',1),(14,'2026_09_28_000013_add_photo_fields_to_users_and_players_table',1),(15,'2026_09_28_000014_create_app_settings_table',1),(16,'2026_09_28_000015_add_branding_to_teams_tournaments_and_matches_table',1),(17,'2026_09_28_000016_add_poster_editor_fields_to_matches_table',1),(18,'2026_09_29_000017_add_flexible_poster_text_editor_fields_to_matches_table',1),(19,'2026_09_29_000018_add_competition_stage_fields_to_matches_table',1),(20,'2026_09_29_000019_add_tournament_access_and_bracket_tree',1),(21,'2026_09_29_000020_add_manager_session_and_substitution_tracking',1),(22,'2026_10_01_000021_add_tournament_description_fields',1),(23,'2026_10_01_000022_add_user_alarm_preferences',1);
/*!40000 ALTER TABLE `migrations` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `password_reset_tokens` (
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `password_reset_tokens` WRITE;
/*!40000 ALTER TABLE `password_reset_tokens` DISABLE KEYS */;
/*!40000 ALTER TABLE `password_reset_tokens` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `players` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `team_id` bigint unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `photo_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `number` tinyint unsigned NOT NULL,
  `position` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `date_of_birth` date DEFAULT NULL,
  `nationality` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Indonesia',
  `height_cm` smallint unsigned DEFAULT NULL,
  `weight_kg` smallint unsigned DEFAULT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `players_team_id_number_unique` (`team_id`,`number`),
  KEY `players_status_index` (`status`),
  CONSTRAINT `players_team_id_foreign` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `players` WRITE;
/*!40000 ALTER TABLE `players` DISABLE KEYS */;
/*!40000 ALTER TABLE `players` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `teams` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `short_name` varchar(12) COLLATE utf8mb4_unicode_ci NOT NULL,
  `city` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `coach_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `home_color` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#2563eb',
  `away_color` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#f8fafc',
  `logo_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `founded_year` smallint unsigned DEFAULT NULL,
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `is_demo` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `teams_short_name_unique` (`short_name`),
  KEY `teams_status_index` (`status`),
  KEY `teams_is_demo_index` (`is_demo`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `teams` WRITE;
/*!40000 ALTER TABLE `teams` DISABLE KEYS */;
/*!40000 ALTER TABLE `teams` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tournament_rules` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `tournament_id` bigint unsigned NOT NULL,
  `category` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'general',
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `sort_order` smallint unsigned NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `tournament_rules_tournament_id_foreign` (`tournament_id`),
  KEY `tournament_rules_category_index` (`category`),
  CONSTRAINT `tournament_rules_tournament_id_foreign` FOREIGN KEY (`tournament_id`) REFERENCES `tournaments` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `tournament_rules` WRITE;
/*!40000 ALTER TABLE `tournament_rules` DISABLE KEYS */;
/*!40000 ALTER TABLE `tournament_rules` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tournament_team` (
  `tournament_id` bigint unsigned NOT NULL,
  `team_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`tournament_id`,`team_id`),
  KEY `tournament_team_team_id_foreign` (`team_id`),
  CONSTRAINT `tournament_team_team_id_foreign` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE,
  CONSTRAINT `tournament_team_tournament_id_foreign` FOREIGN KEY (`tournament_id`) REFERENCES `tournaments` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `tournament_team` WRITE;
/*!40000 ALTER TABLE `tournament_team` DISABLE KEYS */;
/*!40000 ALTER TABLE `tournament_team` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tournaments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `season` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '2026',
  `logo_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `points_win` tinyint unsigned NOT NULL DEFAULT '3',
  `points_draw` tinyint unsigned NOT NULL DEFAULT '1',
  `points_loss` tinyint unsigned NOT NULL DEFAULT '0',
  `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `is_demo` tinyint(1) NOT NULL DEFAULT '0',
  `motto` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `logo_meaning` text COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `tournaments_status_index` (`status`),
  KEY `tournaments_is_demo_index` (`is_demo`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `tournaments` WRITE;
/*!40000 ALTER TABLE `tournaments` DISABLE KEYS */;
/*!40000 ALTER TABLE `tournaments` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `users` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `team_id` bigint unsigned DEFAULT NULL,
  `profile_photo_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `role` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'manager',
  `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `is_demo` tinyint(1) NOT NULL DEFAULT '0',
  `active_session_hash` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `alarm_preset` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'bell',
  `alarm_audio_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `alarm_volume` tinyint unsigned NOT NULL DEFAULT '70',
  PRIMARY KEY (`id`),
  UNIQUE KEY `users_email_unique` (`email`),
  KEY `users_role_index` (`role`),
  KEY `users_team_id_foreign` (`team_id`),
  KEY `users_is_demo_index` (`is_demo`),
  CONSTRAINT `users_team_id_foreign` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,NULL,NULL,'Administrator','admin@ftms.test',NULL,'$2y$12$M8ur5tAHH0zUFD8QM.ROuOP8arMxIN5EbtKGSvaftyhRYGj0StPwG','admin',NULL,'2026-10-06 15:19:02','2026-10-06 15:19:02',0,NULL,'bell',NULL,70);
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `venues` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `city` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `capacity` int unsigned DEFAULT NULL,
  `surface` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'natural grass',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `is_demo` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `venues_is_demo_index` (`is_demo`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `venues` WRITE;
/*!40000 ALTER TABLE `venues` DISABLE KEYS */;
/*!40000 ALTER TABLE `venues` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

