From 7ae0323487c7a16fa23a9ea140c5e8c29b7fbaf0 Mon Sep 17 00:00:00 2001 From: testusuke Date: Thu, 9 May 2024 11:00:12 +0900 Subject: [PATCH 1/2] fix: missing team tags table --- src/main/kotlin/net/sportsday/models/TableInitializer.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/kotlin/net/sportsday/models/TableInitializer.kt b/src/main/kotlin/net/sportsday/models/TableInitializer.kt index 892d555..6f29b9c 100644 --- a/src/main/kotlin/net/sportsday/models/TableInitializer.kt +++ b/src/main/kotlin/net/sportsday/models/TableInitializer.kt @@ -27,6 +27,7 @@ val tables = listOf( Tags, Roles, RolePermissions, + TeamTags, ) fun initializeTables(migrate: Boolean = false) { From dc08bc76761658376228de9fb0011db03ccd4a59 Mon Sep 17 00:00:00 2001 From: testusuke Date: Thu, 9 May 2024 02:02:17 +0000 Subject: [PATCH 2/2] docs: update er diagram --- dbdoc/schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbdoc/schema.json b/dbdoc/schema.json index 3b19dc0..a8eb681 100644 --- a/dbdoc/schema.json +++ b/dbdoc/schema.json @@ -1 +1 @@ -{"name":"db","desc":"","tables":[{"name":"allowed_domains","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"domain","type":"varchar(256)","nullable":false,"default":null,"comment":""},{"name":"description","type":"varchar(128)","nullable":false,"default":null,"comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"allowed_domains","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"allowed_domains","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `allowed_domains` (\n `id` int NOT NULL AUTO_INCREMENT,\n `domain` varchar(256) NOT NULL,\n `description` varchar(128) NOT NULL,\n `created_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"classes","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"name","type":"varchar(64)","nullable":false,"default":null,"comment":""},{"name":"description","type":"varchar(128)","nullable":true,"default":null,"comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""},{"name":"updated_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"classes","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"classes","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `classes` (\n `id` int NOT NULL AUTO_INCREMENT,\n `name` varchar(64) NOT NULL,\n `description` varchar(128) DEFAULT NULL,\n `created_at` datetime(6) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"configuration","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"key","type":"varchar(128)","nullable":false,"default":null,"comment":""},{"name":"value","type":"varchar(1024)","nullable":false,"default":null,"comment":""},{"name":"updated_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"configuration","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"configuration","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `configuration` (\n `id` int NOT NULL AUTO_INCREMENT,\n `key` varchar(128) NOT NULL,\n `value` varchar(1024) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"game_entries","type":"BASE TABLE","comment":"","columns":[{"name":"game","type":"int","nullable":false,"default":null,"comment":""},{"name":"team","type":"int","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"fk_game_entries_team__id","def":"KEY fk_game_entries_team__id (team) USING BTREE","table":"game_entries","columns":["team"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (game, team) USING BTREE","table":"game_entries","columns":["game","team"],"comment":""}],"constraints":[{"name":"fk_game_entries_game__id","type":"FOREIGN KEY","def":"FOREIGN KEY (game) REFERENCES games (id)","table":"game_entries","referenced_table":"games","columns":["game"],"referenced_columns":["id"],"comment":""},{"name":"fk_game_entries_team__id","type":"FOREIGN KEY","def":"FOREIGN KEY (team) REFERENCES teams (id)","table":"game_entries","referenced_table":"teams","columns":["team"],"referenced_columns":["id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (game, team)","table":"game_entries","referenced_table":null,"columns":["game","team"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `game_entries` (\n `game` int NOT NULL,\n `team` int NOT NULL,\n PRIMARY KEY (`game`,`team`),\n KEY `fk_game_entries_team__id` (`team`),\n CONSTRAINT `fk_game_entries_game__id` FOREIGN KEY (`game`) REFERENCES `games` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,\n CONSTRAINT `fk_game_entries_team__id` FOREIGN KEY (`team`) REFERENCES `teams` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"games","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"name","type":"varchar(64)","nullable":false,"default":null,"comment":""},{"name":"description","type":"varchar(512)","nullable":false,"default":null,"comment":""},{"name":"sport","type":"int","nullable":false,"default":null,"comment":""},{"name":"type","type":"varchar(32)","nullable":false,"default":null,"comment":""},{"name":"calculation_type","type":"varchar(32)","nullable":false,"default":"DIFF_SCORE","comment":""},{"name":"weight","type":"int","nullable":false,"default":null,"comment":""},{"name":"tag","type":"int","nullable":true,"default":null,"comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""},{"name":"updated_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"fk_games_sport__id","def":"KEY fk_games_sport__id (sport) USING BTREE","table":"games","columns":["sport"],"comment":""},{"name":"fk_games_tag__id","def":"KEY fk_games_tag__id (tag) USING BTREE","table":"games","columns":["tag"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"games","columns":["id"],"comment":""}],"constraints":[{"name":"fk_games_sport__id","type":"FOREIGN KEY","def":"FOREIGN KEY (sport) REFERENCES sports (id)","table":"games","referenced_table":"sports","columns":["sport"],"referenced_columns":["id"],"comment":""},{"name":"fk_games_tag__id","type":"FOREIGN KEY","def":"FOREIGN KEY (tag) REFERENCES tags (id)","table":"games","referenced_table":"tags","columns":["tag"],"referenced_columns":["id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"games","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `games` (\n `id` int NOT NULL AUTO_INCREMENT,\n `name` varchar(64) NOT NULL,\n `description` varchar(512) NOT NULL,\n `sport` int NOT NULL,\n `type` varchar(32) NOT NULL,\n `calculation_type` varchar(32) NOT NULL DEFAULT 'DIFF_SCORE',\n `weight` int NOT NULL,\n `tag` int DEFAULT NULL,\n `created_at` datetime(6) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `fk_games_sport__id` (`sport`),\n KEY `fk_games_tag__id` (`tag`),\n CONSTRAINT `fk_games_sport__id` FOREIGN KEY (`sport`) REFERENCES `sports` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,\n CONSTRAINT `fk_games_tag__id` FOREIGN KEY (`tag`) REFERENCES `tags` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"images","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"data","type":"text","nullable":false,"default":null,"comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"images","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"images","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `images` (\n `id` int NOT NULL AUTO_INCREMENT,\n `data` text NOT NULL,\n `created_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"information","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"name","type":"varchar(64)","nullable":false,"default":null,"comment":""},{"name":"content","type":"text","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"information","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"information","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `information` (\n `id` int NOT NULL AUTO_INCREMENT,\n `name` varchar(64) NOT NULL,\n `content` text NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"locations","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"name","type":"varchar(64)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"locations","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"locations","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `locations` (\n `id` int NOT NULL AUTO_INCREMENT,\n `name` varchar(64) NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"logs","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"log_event","type":"varchar(32)","nullable":false,"default":null,"comment":""},{"name":"user_id","type":"int","nullable":true,"default":null,"comment":""},{"name":"message","type":"text","nullable":false,"default":null,"comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"fk_logs_user_id__id","def":"KEY fk_logs_user_id__id (user_id) USING BTREE","table":"logs","columns":["user_id"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"logs","columns":["id"],"comment":""}],"constraints":[{"name":"fk_logs_user_id__id","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users (id)","table":"logs","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"logs","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `logs` (\n `id` int NOT NULL AUTO_INCREMENT,\n `log_event` varchar(32) NOT NULL,\n `user_id` int DEFAULT NULL,\n `message` text NOT NULL,\n `created_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `fk_logs_user_id__id` (`user_id`),\n CONSTRAINT `fk_logs_user_id__id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"matches","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"location","type":"int","nullable":true,"default":null,"comment":""},{"name":"game","type":"int","nullable":false,"default":null,"comment":""},{"name":"sport","type":"int","nullable":false,"default":null,"comment":""},{"name":"started_at","type":"datetime(6)","nullable":false,"default":null,"comment":""},{"name":"left_team","type":"int","nullable":true,"default":null,"comment":""},{"name":"right_team","type":"int","nullable":true,"default":null,"comment":""},{"name":"left_score","type":"int","nullable":false,"default":"0","comment":""},{"name":"right_score","type":"int","nullable":false,"default":"0","comment":""},{"name":"result","type":"varchar(32)","nullable":false,"default":"DRAW","comment":""},{"name":"status","type":"varchar(32)","nullable":false,"default":null,"comment":""},{"name":"note","type":"text","nullable":true,"default":null,"comment":""},{"name":"judge_team_id","type":"int","nullable":true,"default":null,"comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""},{"name":"updated_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"fk_matches_game__id","def":"KEY fk_matches_game__id (game) USING BTREE","table":"matches","columns":["game"],"comment":""},{"name":"fk_matches_judge_team_id__id","def":"KEY fk_matches_judge_team_id__id (judge_team_id) USING BTREE","table":"matches","columns":["judge_team_id"],"comment":""},{"name":"fk_matches_left_team__id","def":"KEY fk_matches_left_team__id (left_team) USING BTREE","table":"matches","columns":["left_team"],"comment":""},{"name":"fk_matches_location__id","def":"KEY fk_matches_location__id (location) USING BTREE","table":"matches","columns":["location"],"comment":""},{"name":"fk_matches_right_team__id","def":"KEY fk_matches_right_team__id (right_team) USING BTREE","table":"matches","columns":["right_team"],"comment":""},{"name":"fk_matches_sport__id","def":"KEY fk_matches_sport__id (sport) USING BTREE","table":"matches","columns":["sport"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"matches","columns":["id"],"comment":""}],"constraints":[{"name":"fk_matches_game__id","type":"FOREIGN KEY","def":"FOREIGN KEY (game) REFERENCES games (id)","table":"matches","referenced_table":"games","columns":["game"],"referenced_columns":["id"],"comment":""},{"name":"fk_matches_judge_team_id__id","type":"FOREIGN KEY","def":"FOREIGN KEY (judge_team_id) REFERENCES teams (id)","table":"matches","referenced_table":"teams","columns":["judge_team_id"],"referenced_columns":["id"],"comment":""},{"name":"fk_matches_left_team__id","type":"FOREIGN KEY","def":"FOREIGN KEY (left_team) REFERENCES teams (id)","table":"matches","referenced_table":"teams","columns":["left_team"],"referenced_columns":["id"],"comment":""},{"name":"fk_matches_location__id","type":"FOREIGN KEY","def":"FOREIGN KEY (location) REFERENCES locations (id)","table":"matches","referenced_table":"locations","columns":["location"],"referenced_columns":["id"],"comment":""},{"name":"fk_matches_right_team__id","type":"FOREIGN KEY","def":"FOREIGN KEY (right_team) REFERENCES teams (id)","table":"matches","referenced_table":"teams","columns":["right_team"],"referenced_columns":["id"],"comment":""},{"name":"fk_matches_sport__id","type":"FOREIGN KEY","def":"FOREIGN KEY (sport) REFERENCES sports (id)","table":"matches","referenced_table":"sports","columns":["sport"],"referenced_columns":["id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"matches","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `matches` (\n `id` int NOT NULL AUTO_INCREMENT,\n `location` int DEFAULT NULL,\n `game` int NOT NULL,\n `sport` int NOT NULL,\n `started_at` datetime(6) NOT NULL,\n `left_team` int DEFAULT NULL,\n `right_team` int DEFAULT NULL,\n `left_score` int NOT NULL DEFAULT '0',\n `right_score` int NOT NULL DEFAULT '0',\n `result` varchar(32) NOT NULL DEFAULT 'DRAW',\n `status` varchar(32) NOT NULL,\n `note` text,\n `judge_team_id` int DEFAULT NULL,\n `created_at` datetime(6) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `fk_matches_location__id` (`location`),\n KEY `fk_matches_game__id` (`game`),\n KEY `fk_matches_sport__id` (`sport`),\n KEY `fk_matches_left_team__id` (`left_team`),\n KEY `fk_matches_right_team__id` (`right_team`),\n KEY `fk_matches_judge_team_id__id` (`judge_team_id`),\n CONSTRAINT `fk_matches_game__id` FOREIGN KEY (`game`) REFERENCES `games` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,\n CONSTRAINT `fk_matches_judge_team_id__id` FOREIGN KEY (`judge_team_id`) REFERENCES `teams` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,\n CONSTRAINT `fk_matches_left_team__id` FOREIGN KEY (`left_team`) REFERENCES `teams` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT,\n CONSTRAINT `fk_matches_location__id` FOREIGN KEY (`location`) REFERENCES `locations` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT,\n CONSTRAINT `fk_matches_right_team__id` FOREIGN KEY (`right_team`) REFERENCES `teams` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT,\n CONSTRAINT `fk_matches_sport__id` FOREIGN KEY (`sport`) REFERENCES `sports` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"role_permissions","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"role","type":"int","nullable":false,"default":null,"comment":""},{"name":"permission","type":"varchar(64)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"fk_role_permissions_role__id","def":"KEY fk_role_permissions_role__id (role) USING BTREE","table":"role_permissions","columns":["role"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"role_permissions","columns":["id"],"comment":""}],"constraints":[{"name":"fk_role_permissions_role__id","type":"FOREIGN KEY","def":"FOREIGN KEY (role) REFERENCES roles (id)","table":"role_permissions","referenced_table":"roles","columns":["role"],"referenced_columns":["id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"role_permissions","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `role_permissions` (\n `id` int NOT NULL AUTO_INCREMENT,\n `role` int NOT NULL,\n `permission` varchar(64) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `fk_role_permissions_role__id` (`role`),\n CONSTRAINT `fk_role_permissions_role__id` FOREIGN KEY (`role`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"roles","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"name","type":"varchar(64)","nullable":false,"default":null,"comment":""},{"name":"description","type":"varchar(128)","nullable":false,"default":null,"comment":""},{"name":"default","type":"tinyint(1)","nullable":false,"default":"0","comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""},{"name":"updated_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"roles","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"roles","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `roles` (\n `id` int NOT NULL AUTO_INCREMENT,\n `name` varchar(64) NOT NULL,\n `description` varchar(128) NOT NULL,\n `default` tinyint(1) NOT NULL DEFAULT '0',\n `created_at` datetime(6) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"sports","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"name","type":"varchar(64)","nullable":false,"default":null,"comment":""},{"name":"description","type":"text","nullable":false,"default":null,"comment":""},{"name":"icon_image","type":"int","nullable":true,"default":null,"comment":""},{"name":"weight","type":"int","nullable":false,"default":"0","comment":""},{"name":"rule_id","type":"int","nullable":false,"default":"0","comment":""},{"name":"tag","type":"int","nullable":true,"default":null,"comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""},{"name":"updated_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"fk_sports_icon_image__id","def":"KEY fk_sports_icon_image__id (icon_image) USING BTREE","table":"sports","columns":["icon_image"],"comment":""},{"name":"fk_sports_tag__id","def":"KEY fk_sports_tag__id (tag) USING BTREE","table":"sports","columns":["tag"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"sports","columns":["id"],"comment":""}],"constraints":[{"name":"fk_sports_icon_image__id","type":"FOREIGN KEY","def":"FOREIGN KEY (icon_image) REFERENCES images (id)","table":"sports","referenced_table":"images","columns":["icon_image"],"referenced_columns":["id"],"comment":""},{"name":"fk_sports_tag__id","type":"FOREIGN KEY","def":"FOREIGN KEY (tag) REFERENCES tags (id)","table":"sports","referenced_table":"tags","columns":["tag"],"referenced_columns":["id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"sports","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `sports` (\n `id` int NOT NULL AUTO_INCREMENT,\n `name` varchar(64) NOT NULL,\n `description` text NOT NULL,\n `icon_image` int DEFAULT NULL,\n `weight` int NOT NULL DEFAULT '0',\n `rule_id` int NOT NULL DEFAULT '0',\n `tag` int DEFAULT NULL,\n `created_at` datetime(6) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `fk_sports_icon_image__id` (`icon_image`),\n KEY `fk_sports_tag__id` (`tag`),\n CONSTRAINT `fk_sports_icon_image__id` FOREIGN KEY (`icon_image`) REFERENCES `images` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT,\n CONSTRAINT `fk_sports_tag__id` FOREIGN KEY (`tag`) REFERENCES `tags` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"tags","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"name","type":"varchar(64)","nullable":false,"default":null,"comment":""},{"name":"enabled","type":"tinyint(1)","nullable":false,"default":"1","comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""},{"name":"updated_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"tags","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"tags","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `tags` (\n `id` int NOT NULL AUTO_INCREMENT,\n `name` varchar(64) NOT NULL,\n `enabled` tinyint(1) NOT NULL DEFAULT '1',\n `created_at` datetime(6) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"team_tags","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"name","type":"varchar(64)","nullable":false,"default":null,"comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""},{"name":"updated_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"team_tags","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"team_tags","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `team_tags` (\n `id` int NOT NULL AUTO_INCREMENT,\n `name` varchar(64) NOT NULL,\n `created_at` datetime(6) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"team_users","type":"BASE TABLE","comment":"","columns":[{"name":"team","type":"int","nullable":false,"default":null,"comment":""},{"name":"user","type":"int","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"fk_team_users_user__id","def":"KEY fk_team_users_user__id (user) USING BTREE","table":"team_users","columns":["user"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (team, user) USING BTREE","table":"team_users","columns":["team","user"],"comment":""}],"constraints":[{"name":"fk_team_users_team__id","type":"FOREIGN KEY","def":"FOREIGN KEY (team) REFERENCES teams (id)","table":"team_users","referenced_table":"teams","columns":["team"],"referenced_columns":["id"],"comment":""},{"name":"fk_team_users_user__id","type":"FOREIGN KEY","def":"FOREIGN KEY (user) REFERENCES users (id)","table":"team_users","referenced_table":"users","columns":["user"],"referenced_columns":["id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (team, user)","table":"team_users","referenced_table":null,"columns":["team","user"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `team_users` (\n `team` int NOT NULL,\n `user` int NOT NULL,\n PRIMARY KEY (`team`,`user`),\n KEY `fk_team_users_user__id` (`user`),\n CONSTRAINT `fk_team_users_team__id` FOREIGN KEY (`team`) REFERENCES `teams` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,\n CONSTRAINT `fk_team_users_user__id` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"teams","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"name","type":"varchar(64)","nullable":false,"default":null,"comment":""},{"name":"description","type":"varchar(128)","nullable":true,"default":null,"comment":""},{"name":"class","type":"int","nullable":false,"default":null,"comment":""},{"name":"team_tag","type":"int","nullable":true,"default":null,"comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""},{"name":"updated_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"fk_teams_class__id","def":"KEY fk_teams_class__id (class) USING BTREE","table":"teams","columns":["class"],"comment":""},{"name":"fk_teams_team_tag__id","def":"KEY fk_teams_team_tag__id (team_tag) USING BTREE","table":"teams","columns":["team_tag"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"teams","columns":["id"],"comment":""}],"constraints":[{"name":"fk_teams_class__id","type":"FOREIGN KEY","def":"FOREIGN KEY (class) REFERENCES classes (id)","table":"teams","referenced_table":"classes","columns":["class"],"referenced_columns":["id"],"comment":""},{"name":"fk_teams_team_tag__id","type":"FOREIGN KEY","def":"FOREIGN KEY (team_tag) REFERENCES team_tags (id)","table":"teams","referenced_table":"team_tags","columns":["team_tag"],"referenced_columns":["id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"teams","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `teams` (\n `id` int NOT NULL AUTO_INCREMENT,\n `name` varchar(64) NOT NULL,\n `description` varchar(128) DEFAULT NULL,\n `class` int NOT NULL,\n `team_tag` int DEFAULT NULL,\n `created_at` datetime(6) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `fk_teams_class__id` (`class`),\n KEY `fk_teams_team_tag__id` (`team_tag`),\n CONSTRAINT `fk_teams_class__id` FOREIGN KEY (`class`) REFERENCES `classes` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,\n CONSTRAINT `fk_teams_team_tag__id` FOREIGN KEY (`team_tag`) REFERENCES `team_tags` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"tournament_path","type":"BASE TABLE","comment":"","columns":[{"name":"parent_match","type":"int","nullable":false,"default":null,"comment":""},{"name":"child_match","type":"int","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"fk_tournament_path_child_match__id","def":"KEY fk_tournament_path_child_match__id (child_match) USING BTREE","table":"tournament_path","columns":["child_match"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (parent_match, child_match) USING BTREE","table":"tournament_path","columns":["parent_match","child_match"],"comment":""}],"constraints":[{"name":"fk_tournament_path_child_match__id","type":"FOREIGN KEY","def":"FOREIGN KEY (child_match) REFERENCES matches (id)","table":"tournament_path","referenced_table":"matches","columns":["child_match"],"referenced_columns":["id"],"comment":""},{"name":"fk_tournament_path_parent_match__id","type":"FOREIGN KEY","def":"FOREIGN KEY (parent_match) REFERENCES matches (id)","table":"tournament_path","referenced_table":"matches","columns":["parent_match"],"referenced_columns":["id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (parent_match, child_match)","table":"tournament_path","referenced_table":null,"columns":["parent_match","child_match"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `tournament_path` (\n `parent_match` int NOT NULL,\n `child_match` int NOT NULL,\n PRIMARY KEY (`parent_match`,`child_match`),\n KEY `fk_tournament_path_child_match__id` (`child_match`),\n CONSTRAINT `fk_tournament_path_child_match__id` FOREIGN KEY (`child_match`) REFERENCES `matches` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,\n CONSTRAINT `fk_tournament_path_parent_match__id` FOREIGN KEY (`parent_match`) REFERENCES `matches` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"users","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"name","type":"varchar(128)","nullable":false,"default":null,"comment":""},{"name":"email","type":"varchar(320)","nullable":false,"default":null,"comment":""},{"name":"gender","type":"varchar(10)","nullable":false,"default":"MALE","comment":""},{"name":"picture_id","type":"int","nullable":true,"default":null,"comment":""},{"name":"class_id","type":"int","nullable":true,"default":null,"comment":""},{"name":"role_id","type":"int","nullable":true,"default":null,"comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""},{"name":"updated_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"fk_users_class_id__id","def":"KEY fk_users_class_id__id (class_id) USING BTREE","table":"users","columns":["class_id"],"comment":""},{"name":"fk_users_picture_id__id","def":"KEY fk_users_picture_id__id (picture_id) USING BTREE","table":"users","columns":["picture_id"],"comment":""},{"name":"fk_users_role_id__id","def":"KEY fk_users_role_id__id (role_id) USING BTREE","table":"users","columns":["role_id"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"users","columns":["id"],"comment":""},{"name":"users_email_unique","def":"UNIQUE KEY users_email_unique (email) USING BTREE","table":"users","columns":["email"],"comment":""}],"constraints":[{"name":"fk_users_class_id__id","type":"FOREIGN KEY","def":"FOREIGN KEY (class_id) REFERENCES classes (id)","table":"users","referenced_table":"classes","columns":["class_id"],"referenced_columns":["id"],"comment":""},{"name":"fk_users_picture_id__id","type":"FOREIGN KEY","def":"FOREIGN KEY (picture_id) REFERENCES images (id)","table":"users","referenced_table":"images","columns":["picture_id"],"referenced_columns":["id"],"comment":""},{"name":"fk_users_role_id__id","type":"FOREIGN KEY","def":"FOREIGN KEY (role_id) REFERENCES roles (id)","table":"users","referenced_table":"roles","columns":["role_id"],"referenced_columns":["id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"users","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"users_email_unique","type":"UNIQUE","def":"UNIQUE KEY users_email_unique (email)","table":"users","referenced_table":null,"columns":["email"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `users` (\n `id` int NOT NULL AUTO_INCREMENT,\n `name` varchar(128) NOT NULL,\n `email` varchar(320) NOT NULL,\n `gender` varchar(10) NOT NULL DEFAULT 'MALE',\n `picture_id` int DEFAULT NULL,\n `class_id` int DEFAULT NULL,\n `role_id` int DEFAULT NULL,\n `created_at` datetime(6) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `users_email_unique` (`email`),\n KEY `fk_users_picture_id__id` (`picture_id`),\n KEY `fk_users_class_id__id` (`class_id`),\n KEY `fk_users_role_id__id` (`role_id`),\n CONSTRAINT `fk_users_class_id__id` FOREIGN KEY (`class_id`) REFERENCES `classes` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,\n CONSTRAINT `fk_users_picture_id__id` FOREIGN KEY (`picture_id`) REFERENCES `images` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT,\n CONSTRAINT `fk_users_role_id__id` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"}],"relations":[{"table":"game_entries","columns":["game"],"cardinality":"Zero or more","parent_table":"games","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (game) REFERENCES games (id)","virtual":false},{"table":"game_entries","columns":["team"],"cardinality":"Zero or more","parent_table":"teams","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (team) REFERENCES teams (id)","virtual":false},{"table":"games","columns":["sport"],"cardinality":"Zero or more","parent_table":"sports","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (sport) REFERENCES sports (id)","virtual":false},{"table":"games","columns":["tag"],"cardinality":"Zero or more","parent_table":"tags","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (tag) REFERENCES tags (id)","virtual":false},{"table":"logs","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (user_id) REFERENCES users (id)","virtual":false},{"table":"matches","columns":["game"],"cardinality":"Zero or more","parent_table":"games","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (game) REFERENCES games (id)","virtual":false},{"table":"matches","columns":["judge_team_id"],"cardinality":"Zero or more","parent_table":"teams","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (judge_team_id) REFERENCES teams (id)","virtual":false},{"table":"matches","columns":["left_team"],"cardinality":"Zero or more","parent_table":"teams","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (left_team) REFERENCES teams (id)","virtual":false},{"table":"matches","columns":["location"],"cardinality":"Zero or more","parent_table":"locations","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (location) REFERENCES locations (id)","virtual":false},{"table":"matches","columns":["right_team"],"cardinality":"Zero or more","parent_table":"teams","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (right_team) REFERENCES teams (id)","virtual":false},{"table":"matches","columns":["sport"],"cardinality":"Zero or more","parent_table":"sports","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (sport) REFERENCES sports (id)","virtual":false},{"table":"role_permissions","columns":["role"],"cardinality":"Zero or more","parent_table":"roles","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (role) REFERENCES roles (id)","virtual":false},{"table":"sports","columns":["icon_image"],"cardinality":"Zero or more","parent_table":"images","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (icon_image) REFERENCES images (id)","virtual":false},{"table":"sports","columns":["tag"],"cardinality":"Zero or more","parent_table":"tags","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (tag) REFERENCES tags (id)","virtual":false},{"table":"team_users","columns":["team"],"cardinality":"Zero or more","parent_table":"teams","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (team) REFERENCES teams (id)","virtual":false},{"table":"team_users","columns":["user"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user) REFERENCES users (id)","virtual":false},{"table":"teams","columns":["class"],"cardinality":"Zero or more","parent_table":"classes","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (class) REFERENCES classes (id)","virtual":false},{"table":"teams","columns":["team_tag"],"cardinality":"Zero or more","parent_table":"team_tags","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (team_tag) REFERENCES team_tags (id)","virtual":false},{"table":"tournament_path","columns":["child_match"],"cardinality":"Zero or more","parent_table":"matches","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (child_match) REFERENCES matches (id)","virtual":false},{"table":"tournament_path","columns":["parent_match"],"cardinality":"Zero or more","parent_table":"matches","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (parent_match) REFERENCES matches (id)","virtual":false},{"table":"users","columns":["class_id"],"cardinality":"Zero or more","parent_table":"classes","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (class_id) REFERENCES classes (id)","virtual":false},{"table":"users","columns":["picture_id"],"cardinality":"Zero or more","parent_table":"images","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (picture_id) REFERENCES images (id)","virtual":false},{"table":"users","columns":["role_id"],"cardinality":"Zero or more","parent_table":"roles","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (role_id) REFERENCES roles (id)","virtual":false}],"functions":[],"driver":{"name":"mysql","database_version":"8.0.36","meta":{"dict":{"Functions":"Stored procedures and functions"}}}} +{"name":"db","desc":"","tables":[{"name":"allowed_domains","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"domain","type":"varchar(256)","nullable":false,"default":null,"comment":""},{"name":"description","type":"varchar(128)","nullable":false,"default":null,"comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"allowed_domains","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"allowed_domains","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `allowed_domains` (\n `id` int NOT NULL AUTO_INCREMENT,\n `domain` varchar(256) NOT NULL,\n `description` varchar(128) NOT NULL,\n `created_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"classes","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"name","type":"varchar(64)","nullable":false,"default":null,"comment":""},{"name":"description","type":"varchar(128)","nullable":true,"default":null,"comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""},{"name":"updated_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"classes","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"classes","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `classes` (\n `id` int NOT NULL AUTO_INCREMENT,\n `name` varchar(64) NOT NULL,\n `description` varchar(128) DEFAULT NULL,\n `created_at` datetime(6) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"configuration","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"key","type":"varchar(128)","nullable":false,"default":null,"comment":""},{"name":"value","type":"varchar(1024)","nullable":false,"default":null,"comment":""},{"name":"updated_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"configuration","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"configuration","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `configuration` (\n `id` int NOT NULL AUTO_INCREMENT,\n `key` varchar(128) NOT NULL,\n `value` varchar(1024) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"game_entries","type":"BASE TABLE","comment":"","columns":[{"name":"game","type":"int","nullable":false,"default":null,"comment":""},{"name":"team","type":"int","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"fk_game_entries_team__id","def":"KEY fk_game_entries_team__id (team) USING BTREE","table":"game_entries","columns":["team"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (game, team) USING BTREE","table":"game_entries","columns":["game","team"],"comment":""}],"constraints":[{"name":"fk_game_entries_game__id","type":"FOREIGN KEY","def":"FOREIGN KEY (game) REFERENCES games (id)","table":"game_entries","referenced_table":"games","columns":["game"],"referenced_columns":["id"],"comment":""},{"name":"fk_game_entries_team__id","type":"FOREIGN KEY","def":"FOREIGN KEY (team) REFERENCES teams (id)","table":"game_entries","referenced_table":"teams","columns":["team"],"referenced_columns":["id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (game, team)","table":"game_entries","referenced_table":null,"columns":["game","team"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `game_entries` (\n `game` int NOT NULL,\n `team` int NOT NULL,\n PRIMARY KEY (`game`,`team`),\n KEY `fk_game_entries_team__id` (`team`),\n CONSTRAINT `fk_game_entries_game__id` FOREIGN KEY (`game`) REFERENCES `games` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,\n CONSTRAINT `fk_game_entries_team__id` FOREIGN KEY (`team`) REFERENCES `teams` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"games","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"name","type":"varchar(64)","nullable":false,"default":null,"comment":""},{"name":"description","type":"varchar(512)","nullable":false,"default":null,"comment":""},{"name":"sport","type":"int","nullable":false,"default":null,"comment":""},{"name":"type","type":"varchar(32)","nullable":false,"default":null,"comment":""},{"name":"calculation_type","type":"varchar(32)","nullable":false,"default":"DIFF_SCORE","comment":""},{"name":"weight","type":"int","nullable":false,"default":null,"comment":""},{"name":"tag","type":"int","nullable":true,"default":null,"comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""},{"name":"updated_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"fk_games_sport__id","def":"KEY fk_games_sport__id (sport) USING BTREE","table":"games","columns":["sport"],"comment":""},{"name":"fk_games_tag__id","def":"KEY fk_games_tag__id (tag) USING BTREE","table":"games","columns":["tag"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"games","columns":["id"],"comment":""}],"constraints":[{"name":"fk_games_sport__id","type":"FOREIGN KEY","def":"FOREIGN KEY (sport) REFERENCES sports (id)","table":"games","referenced_table":"sports","columns":["sport"],"referenced_columns":["id"],"comment":""},{"name":"fk_games_tag__id","type":"FOREIGN KEY","def":"FOREIGN KEY (tag) REFERENCES tags (id)","table":"games","referenced_table":"tags","columns":["tag"],"referenced_columns":["id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"games","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `games` (\n `id` int NOT NULL AUTO_INCREMENT,\n `name` varchar(64) NOT NULL,\n `description` varchar(512) NOT NULL,\n `sport` int NOT NULL,\n `type` varchar(32) NOT NULL,\n `calculation_type` varchar(32) NOT NULL DEFAULT 'DIFF_SCORE',\n `weight` int NOT NULL,\n `tag` int DEFAULT NULL,\n `created_at` datetime(6) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `fk_games_sport__id` (`sport`),\n KEY `fk_games_tag__id` (`tag`),\n CONSTRAINT `fk_games_sport__id` FOREIGN KEY (`sport`) REFERENCES `sports` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,\n CONSTRAINT `fk_games_tag__id` FOREIGN KEY (`tag`) REFERENCES `tags` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"images","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"data","type":"text","nullable":false,"default":null,"comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"images","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"images","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `images` (\n `id` int NOT NULL AUTO_INCREMENT,\n `data` text NOT NULL,\n `created_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"information","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"name","type":"varchar(64)","nullable":false,"default":null,"comment":""},{"name":"content","type":"text","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"information","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"information","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `information` (\n `id` int NOT NULL AUTO_INCREMENT,\n `name` varchar(64) NOT NULL,\n `content` text NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"locations","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"name","type":"varchar(64)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"locations","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"locations","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `locations` (\n `id` int NOT NULL AUTO_INCREMENT,\n `name` varchar(64) NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"logs","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"log_event","type":"varchar(32)","nullable":false,"default":null,"comment":""},{"name":"user_id","type":"int","nullable":true,"default":null,"comment":""},{"name":"message","type":"text","nullable":false,"default":null,"comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"fk_logs_user_id__id","def":"KEY fk_logs_user_id__id (user_id) USING BTREE","table":"logs","columns":["user_id"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"logs","columns":["id"],"comment":""}],"constraints":[{"name":"fk_logs_user_id__id","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users (id)","table":"logs","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"logs","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `logs` (\n `id` int NOT NULL AUTO_INCREMENT,\n `log_event` varchar(32) NOT NULL,\n `user_id` int DEFAULT NULL,\n `message` text NOT NULL,\n `created_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `fk_logs_user_id__id` (`user_id`),\n CONSTRAINT `fk_logs_user_id__id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"matches","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"location","type":"int","nullable":true,"default":null,"comment":""},{"name":"game","type":"int","nullable":false,"default":null,"comment":""},{"name":"sport","type":"int","nullable":false,"default":null,"comment":""},{"name":"started_at","type":"datetime(6)","nullable":false,"default":null,"comment":""},{"name":"left_team","type":"int","nullable":true,"default":null,"comment":""},{"name":"right_team","type":"int","nullable":true,"default":null,"comment":""},{"name":"left_score","type":"int","nullable":false,"default":"0","comment":""},{"name":"right_score","type":"int","nullable":false,"default":"0","comment":""},{"name":"result","type":"varchar(32)","nullable":false,"default":"DRAW","comment":""},{"name":"status","type":"varchar(32)","nullable":false,"default":null,"comment":""},{"name":"note","type":"text","nullable":true,"default":null,"comment":""},{"name":"judge_team_id","type":"int","nullable":true,"default":null,"comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""},{"name":"updated_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"fk_matches_game__id","def":"KEY fk_matches_game__id (game) USING BTREE","table":"matches","columns":["game"],"comment":""},{"name":"fk_matches_judge_team_id__id","def":"KEY fk_matches_judge_team_id__id (judge_team_id) USING BTREE","table":"matches","columns":["judge_team_id"],"comment":""},{"name":"fk_matches_left_team__id","def":"KEY fk_matches_left_team__id (left_team) USING BTREE","table":"matches","columns":["left_team"],"comment":""},{"name":"fk_matches_location__id","def":"KEY fk_matches_location__id (location) USING BTREE","table":"matches","columns":["location"],"comment":""},{"name":"fk_matches_right_team__id","def":"KEY fk_matches_right_team__id (right_team) USING BTREE","table":"matches","columns":["right_team"],"comment":""},{"name":"fk_matches_sport__id","def":"KEY fk_matches_sport__id (sport) USING BTREE","table":"matches","columns":["sport"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"matches","columns":["id"],"comment":""}],"constraints":[{"name":"fk_matches_game__id","type":"FOREIGN KEY","def":"FOREIGN KEY (game) REFERENCES games (id)","table":"matches","referenced_table":"games","columns":["game"],"referenced_columns":["id"],"comment":""},{"name":"fk_matches_judge_team_id__id","type":"FOREIGN KEY","def":"FOREIGN KEY (judge_team_id) REFERENCES teams (id)","table":"matches","referenced_table":"teams","columns":["judge_team_id"],"referenced_columns":["id"],"comment":""},{"name":"fk_matches_left_team__id","type":"FOREIGN KEY","def":"FOREIGN KEY (left_team) REFERENCES teams (id)","table":"matches","referenced_table":"teams","columns":["left_team"],"referenced_columns":["id"],"comment":""},{"name":"fk_matches_location__id","type":"FOREIGN KEY","def":"FOREIGN KEY (location) REFERENCES locations (id)","table":"matches","referenced_table":"locations","columns":["location"],"referenced_columns":["id"],"comment":""},{"name":"fk_matches_right_team__id","type":"FOREIGN KEY","def":"FOREIGN KEY (right_team) REFERENCES teams (id)","table":"matches","referenced_table":"teams","columns":["right_team"],"referenced_columns":["id"],"comment":""},{"name":"fk_matches_sport__id","type":"FOREIGN KEY","def":"FOREIGN KEY (sport) REFERENCES sports (id)","table":"matches","referenced_table":"sports","columns":["sport"],"referenced_columns":["id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"matches","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `matches` (\n `id` int NOT NULL AUTO_INCREMENT,\n `location` int DEFAULT NULL,\n `game` int NOT NULL,\n `sport` int NOT NULL,\n `started_at` datetime(6) NOT NULL,\n `left_team` int DEFAULT NULL,\n `right_team` int DEFAULT NULL,\n `left_score` int NOT NULL DEFAULT '0',\n `right_score` int NOT NULL DEFAULT '0',\n `result` varchar(32) NOT NULL DEFAULT 'DRAW',\n `status` varchar(32) NOT NULL,\n `note` text,\n `judge_team_id` int DEFAULT NULL,\n `created_at` datetime(6) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `fk_matches_location__id` (`location`),\n KEY `fk_matches_game__id` (`game`),\n KEY `fk_matches_sport__id` (`sport`),\n KEY `fk_matches_left_team__id` (`left_team`),\n KEY `fk_matches_right_team__id` (`right_team`),\n KEY `fk_matches_judge_team_id__id` (`judge_team_id`),\n CONSTRAINT `fk_matches_game__id` FOREIGN KEY (`game`) REFERENCES `games` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,\n CONSTRAINT `fk_matches_judge_team_id__id` FOREIGN KEY (`judge_team_id`) REFERENCES `teams` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,\n CONSTRAINT `fk_matches_left_team__id` FOREIGN KEY (`left_team`) REFERENCES `teams` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT,\n CONSTRAINT `fk_matches_location__id` FOREIGN KEY (`location`) REFERENCES `locations` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT,\n CONSTRAINT `fk_matches_right_team__id` FOREIGN KEY (`right_team`) REFERENCES `teams` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT,\n CONSTRAINT `fk_matches_sport__id` FOREIGN KEY (`sport`) REFERENCES `sports` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"role_permissions","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"role","type":"int","nullable":false,"default":null,"comment":""},{"name":"permission","type":"varchar(64)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"fk_role_permissions_role__id","def":"KEY fk_role_permissions_role__id (role) USING BTREE","table":"role_permissions","columns":["role"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"role_permissions","columns":["id"],"comment":""}],"constraints":[{"name":"fk_role_permissions_role__id","type":"FOREIGN KEY","def":"FOREIGN KEY (role) REFERENCES roles (id)","table":"role_permissions","referenced_table":"roles","columns":["role"],"referenced_columns":["id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"role_permissions","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `role_permissions` (\n `id` int NOT NULL AUTO_INCREMENT,\n `role` int NOT NULL,\n `permission` varchar(64) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `fk_role_permissions_role__id` (`role`),\n CONSTRAINT `fk_role_permissions_role__id` FOREIGN KEY (`role`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"roles","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"name","type":"varchar(64)","nullable":false,"default":null,"comment":""},{"name":"description","type":"varchar(128)","nullable":false,"default":null,"comment":""},{"name":"default","type":"tinyint(1)","nullable":false,"default":"0","comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""},{"name":"updated_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"roles","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"roles","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `roles` (\n `id` int NOT NULL AUTO_INCREMENT,\n `name` varchar(64) NOT NULL,\n `description` varchar(128) NOT NULL,\n `default` tinyint(1) NOT NULL DEFAULT '0',\n `created_at` datetime(6) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"sports","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"name","type":"varchar(64)","nullable":false,"default":null,"comment":""},{"name":"description","type":"text","nullable":false,"default":null,"comment":""},{"name":"icon_image","type":"int","nullable":true,"default":null,"comment":""},{"name":"weight","type":"int","nullable":false,"default":"0","comment":""},{"name":"rule_id","type":"int","nullable":false,"default":"0","comment":""},{"name":"tag","type":"int","nullable":true,"default":null,"comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""},{"name":"updated_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"fk_sports_icon_image__id","def":"KEY fk_sports_icon_image__id (icon_image) USING BTREE","table":"sports","columns":["icon_image"],"comment":""},{"name":"fk_sports_tag__id","def":"KEY fk_sports_tag__id (tag) USING BTREE","table":"sports","columns":["tag"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"sports","columns":["id"],"comment":""}],"constraints":[{"name":"fk_sports_icon_image__id","type":"FOREIGN KEY","def":"FOREIGN KEY (icon_image) REFERENCES images (id)","table":"sports","referenced_table":"images","columns":["icon_image"],"referenced_columns":["id"],"comment":""},{"name":"fk_sports_tag__id","type":"FOREIGN KEY","def":"FOREIGN KEY (tag) REFERENCES tags (id)","table":"sports","referenced_table":"tags","columns":["tag"],"referenced_columns":["id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"sports","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `sports` (\n `id` int NOT NULL AUTO_INCREMENT,\n `name` varchar(64) NOT NULL,\n `description` text NOT NULL,\n `icon_image` int DEFAULT NULL,\n `weight` int NOT NULL DEFAULT '0',\n `rule_id` int NOT NULL DEFAULT '0',\n `tag` int DEFAULT NULL,\n `created_at` datetime(6) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `fk_sports_icon_image__id` (`icon_image`),\n KEY `fk_sports_tag__id` (`tag`),\n CONSTRAINT `fk_sports_icon_image__id` FOREIGN KEY (`icon_image`) REFERENCES `images` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT,\n CONSTRAINT `fk_sports_tag__id` FOREIGN KEY (`tag`) REFERENCES `tags` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"tags","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"name","type":"varchar(64)","nullable":false,"default":null,"comment":""},{"name":"enabled","type":"tinyint(1)","nullable":false,"default":"1","comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""},{"name":"updated_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"tags","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"tags","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `tags` (\n `id` int NOT NULL AUTO_INCREMENT,\n `name` varchar(64) NOT NULL,\n `enabled` tinyint(1) NOT NULL DEFAULT '1',\n `created_at` datetime(6) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"team_tags","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"name","type":"varchar(64)","nullable":false,"default":null,"comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""},{"name":"updated_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"team_tags","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"team_tags","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `team_tags` (\n `id` int NOT NULL AUTO_INCREMENT,\n `name` varchar(64) NOT NULL,\n `created_at` datetime(6) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"team_users","type":"BASE TABLE","comment":"","columns":[{"name":"team","type":"int","nullable":false,"default":null,"comment":""},{"name":"user","type":"int","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"fk_team_users_user__id","def":"KEY fk_team_users_user__id (user) USING BTREE","table":"team_users","columns":["user"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (team, user) USING BTREE","table":"team_users","columns":["team","user"],"comment":""}],"constraints":[{"name":"fk_team_users_team__id","type":"FOREIGN KEY","def":"FOREIGN KEY (team) REFERENCES teams (id)","table":"team_users","referenced_table":"teams","columns":["team"],"referenced_columns":["id"],"comment":""},{"name":"fk_team_users_user__id","type":"FOREIGN KEY","def":"FOREIGN KEY (user) REFERENCES users (id)","table":"team_users","referenced_table":"users","columns":["user"],"referenced_columns":["id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (team, user)","table":"team_users","referenced_table":null,"columns":["team","user"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `team_users` (\n `team` int NOT NULL,\n `user` int NOT NULL,\n PRIMARY KEY (`team`,`user`),\n KEY `fk_team_users_user__id` (`user`),\n CONSTRAINT `fk_team_users_team__id` FOREIGN KEY (`team`) REFERENCES `teams` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,\n CONSTRAINT `fk_team_users_user__id` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"teams","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"name","type":"varchar(64)","nullable":false,"default":null,"comment":""},{"name":"description","type":"varchar(128)","nullable":true,"default":null,"comment":""},{"name":"class","type":"int","nullable":false,"default":null,"comment":""},{"name":"team_tag","type":"int","nullable":true,"default":null,"comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""},{"name":"updated_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"fk_teams_class__id","def":"KEY fk_teams_class__id (class) USING BTREE","table":"teams","columns":["class"],"comment":""},{"name":"fk_teams_team_tag__id","def":"KEY fk_teams_team_tag__id (team_tag) USING BTREE","table":"teams","columns":["team_tag"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"teams","columns":["id"],"comment":""}],"constraints":[{"name":"fk_teams_class__id","type":"FOREIGN KEY","def":"FOREIGN KEY (class) REFERENCES classes (id)","table":"teams","referenced_table":"classes","columns":["class"],"referenced_columns":["id"],"comment":""},{"name":"fk_teams_team_tag__id","type":"FOREIGN KEY","def":"FOREIGN KEY (team_tag) REFERENCES team_tags (id)","table":"teams","referenced_table":"team_tags","columns":["team_tag"],"referenced_columns":["id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"teams","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `teams` (\n `id` int NOT NULL AUTO_INCREMENT,\n `name` varchar(64) NOT NULL,\n `description` varchar(128) DEFAULT NULL,\n `class` int NOT NULL,\n `team_tag` int DEFAULT NULL,\n `created_at` datetime(6) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `fk_teams_class__id` (`class`),\n KEY `fk_teams_team_tag__id` (`team_tag`),\n CONSTRAINT `fk_teams_class__id` FOREIGN KEY (`class`) REFERENCES `classes` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,\n CONSTRAINT `fk_teams_team_tag__id` FOREIGN KEY (`team_tag`) REFERENCES `team_tags` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"tournament_path","type":"BASE TABLE","comment":"","columns":[{"name":"parent_match","type":"int","nullable":false,"default":null,"comment":""},{"name":"child_match","type":"int","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"fk_tournament_path_child_match__id","def":"KEY fk_tournament_path_child_match__id (child_match) USING BTREE","table":"tournament_path","columns":["child_match"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (parent_match, child_match) USING BTREE","table":"tournament_path","columns":["parent_match","child_match"],"comment":""}],"constraints":[{"name":"fk_tournament_path_child_match__id","type":"FOREIGN KEY","def":"FOREIGN KEY (child_match) REFERENCES matches (id)","table":"tournament_path","referenced_table":"matches","columns":["child_match"],"referenced_columns":["id"],"comment":""},{"name":"fk_tournament_path_parent_match__id","type":"FOREIGN KEY","def":"FOREIGN KEY (parent_match) REFERENCES matches (id)","table":"tournament_path","referenced_table":"matches","columns":["parent_match"],"referenced_columns":["id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (parent_match, child_match)","table":"tournament_path","referenced_table":null,"columns":["parent_match","child_match"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `tournament_path` (\n `parent_match` int NOT NULL,\n `child_match` int NOT NULL,\n PRIMARY KEY (`parent_match`,`child_match`),\n KEY `fk_tournament_path_child_match__id` (`child_match`),\n CONSTRAINT `fk_tournament_path_child_match__id` FOREIGN KEY (`child_match`) REFERENCES `matches` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,\n CONSTRAINT `fk_tournament_path_parent_match__id` FOREIGN KEY (`parent_match`) REFERENCES `matches` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"},{"name":"users","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"name","type":"varchar(128)","nullable":false,"default":null,"comment":""},{"name":"email","type":"varchar(320)","nullable":false,"default":null,"comment":""},{"name":"gender","type":"varchar(10)","nullable":false,"default":"MALE","comment":""},{"name":"picture_id","type":"int","nullable":true,"default":null,"comment":""},{"name":"class_id","type":"int","nullable":true,"default":null,"comment":""},{"name":"role_id","type":"int","nullable":true,"default":null,"comment":""},{"name":"created_at","type":"datetime(6)","nullable":false,"default":null,"comment":""},{"name":"updated_at","type":"datetime(6)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"fk_users_class_id__id","def":"KEY fk_users_class_id__id (class_id) USING BTREE","table":"users","columns":["class_id"],"comment":""},{"name":"fk_users_picture_id__id","def":"KEY fk_users_picture_id__id (picture_id) USING BTREE","table":"users","columns":["picture_id"],"comment":""},{"name":"fk_users_role_id__id","def":"KEY fk_users_role_id__id (role_id) USING BTREE","table":"users","columns":["role_id"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"users","columns":["id"],"comment":""},{"name":"users_email_unique","def":"UNIQUE KEY users_email_unique (email) USING BTREE","table":"users","columns":["email"],"comment":""}],"constraints":[{"name":"fk_users_class_id__id","type":"FOREIGN KEY","def":"FOREIGN KEY (class_id) REFERENCES classes (id)","table":"users","referenced_table":"classes","columns":["class_id"],"referenced_columns":["id"],"comment":""},{"name":"fk_users_picture_id__id","type":"FOREIGN KEY","def":"FOREIGN KEY (picture_id) REFERENCES images (id)","table":"users","referenced_table":"images","columns":["picture_id"],"referenced_columns":["id"],"comment":""},{"name":"fk_users_role_id__id","type":"FOREIGN KEY","def":"FOREIGN KEY (role_id) REFERENCES roles (id)","table":"users","referenced_table":"roles","columns":["role_id"],"referenced_columns":["id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"users","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"users_email_unique","type":"UNIQUE","def":"UNIQUE KEY users_email_unique (email)","table":"users","referenced_table":null,"columns":["email"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `users` (\n `id` int NOT NULL AUTO_INCREMENT,\n `name` varchar(128) NOT NULL,\n `email` varchar(320) NOT NULL,\n `gender` varchar(10) NOT NULL DEFAULT 'MALE',\n `picture_id` int DEFAULT NULL,\n `class_id` int DEFAULT NULL,\n `role_id` int DEFAULT NULL,\n `created_at` datetime(6) NOT NULL,\n `updated_at` datetime(6) NOT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `users_email_unique` (`email`),\n KEY `fk_users_picture_id__id` (`picture_id`),\n KEY `fk_users_class_id__id` (`class_id`),\n KEY `fk_users_role_id__id` (`role_id`),\n CONSTRAINT `fk_users_class_id__id` FOREIGN KEY (`class_id`) REFERENCES `classes` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,\n CONSTRAINT `fk_users_picture_id__id` FOREIGN KEY (`picture_id`) REFERENCES `images` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT,\n CONSTRAINT `fk_users_role_id__id` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE SET NULL ON UPDATE RESTRICT\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci"}],"relations":[{"table":"game_entries","columns":["game"],"cardinality":"Zero or more","parent_table":"games","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (game) REFERENCES games (id)","virtual":false},{"table":"game_entries","columns":["team"],"cardinality":"Zero or more","parent_table":"teams","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (team) REFERENCES teams (id)","virtual":false},{"table":"games","columns":["sport"],"cardinality":"Zero or more","parent_table":"sports","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (sport) REFERENCES sports (id)","virtual":false},{"table":"games","columns":["tag"],"cardinality":"Zero or more","parent_table":"tags","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (tag) REFERENCES tags (id)","virtual":false},{"table":"logs","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (user_id) REFERENCES users (id)","virtual":false},{"table":"matches","columns":["game"],"cardinality":"Zero or more","parent_table":"games","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (game) REFERENCES games (id)","virtual":false},{"table":"matches","columns":["judge_team_id"],"cardinality":"Zero or more","parent_table":"teams","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (judge_team_id) REFERENCES teams (id)","virtual":false},{"table":"matches","columns":["left_team"],"cardinality":"Zero or more","parent_table":"teams","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (left_team) REFERENCES teams (id)","virtual":false},{"table":"matches","columns":["location"],"cardinality":"Zero or more","parent_table":"locations","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (location) REFERENCES locations (id)","virtual":false},{"table":"matches","columns":["right_team"],"cardinality":"Zero or more","parent_table":"teams","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (right_team) REFERENCES teams (id)","virtual":false},{"table":"matches","columns":["sport"],"cardinality":"Zero or more","parent_table":"sports","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (sport) REFERENCES sports (id)","virtual":false},{"table":"role_permissions","columns":["role"],"cardinality":"Zero or more","parent_table":"roles","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (role) REFERENCES roles (id)","virtual":false},{"table":"sports","columns":["icon_image"],"cardinality":"Zero or more","parent_table":"images","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (icon_image) REFERENCES images (id)","virtual":false},{"table":"sports","columns":["tag"],"cardinality":"Zero or more","parent_table":"tags","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (tag) REFERENCES tags (id)","virtual":false},{"table":"team_users","columns":["team"],"cardinality":"Zero or more","parent_table":"teams","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (team) REFERENCES teams (id)","virtual":false},{"table":"team_users","columns":["user"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user) REFERENCES users (id)","virtual":false},{"table":"teams","columns":["class"],"cardinality":"Zero or more","parent_table":"classes","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (class) REFERENCES classes (id)","virtual":false},{"table":"teams","columns":["team_tag"],"cardinality":"Zero or more","parent_table":"team_tags","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (team_tag) REFERENCES team_tags (id)","virtual":false},{"table":"tournament_path","columns":["child_match"],"cardinality":"Zero or more","parent_table":"matches","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (child_match) REFERENCES matches (id)","virtual":false},{"table":"tournament_path","columns":["parent_match"],"cardinality":"Zero or more","parent_table":"matches","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (parent_match) REFERENCES matches (id)","virtual":false},{"table":"users","columns":["class_id"],"cardinality":"Zero or more","parent_table":"classes","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (class_id) REFERENCES classes (id)","virtual":false},{"table":"users","columns":["picture_id"],"cardinality":"Zero or more","parent_table":"images","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (picture_id) REFERENCES images (id)","virtual":false},{"table":"users","columns":["role_id"],"cardinality":"Zero or more","parent_table":"roles","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (role_id) REFERENCES roles (id)","virtual":false}],"functions":[],"driver":{"name":"mysql","database_version":"8.0.37","meta":{"dict":{"Functions":"Stored procedures and functions"}}}}