{
  "query": "CREATE TABLE `leaderboards` (\n\t`id` int AUTO_INCREMENT NOT NULL,\n\t`userId` int NOT NULL,\n\t`leaderboardType` enum('global','weekly','daily','game_specific') NOT NULL,\n\t`gameId` int,\n\t`totalWinnings` decimal(15,2) NOT NULL DEFAULT '0.00',\n\t`totalBets` decimal(15,2) NOT NULL DEFAULT '0.00',\n\t`winCount` int NOT NULL DEFAULT 0,\n\t`rank` int NOT NULL DEFAULT 0,\n\t`period` varchar(20),\n\t`updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,\n\t`createdAt` timestamp NOT NULL DEFAULT (now()),\n\tCONSTRAINT `leaderboards_id` PRIMARY KEY(`id`)\n);\nCREATE TABLE `tournament_participants` (\n\t`id` int AUTO_INCREMENT NOT NULL,\n\t`tournamentId` int NOT NULL,\n\t`userId` int NOT NULL,\n\t`score` decimal(15,2) NOT NULL DEFAULT '0.00',\n\t`finalRank` int,\n\t`prizeWon` decimal(15,2) DEFAULT '0.00',\n\t`joinedAt` timestamp NOT NULL DEFAULT (now()),\n\t`completedAt` timestamp,\n\tCONSTRAINT `tournament_participants_id` PRIMARY KEY(`id`)\n);\nCREATE TABLE `tournament_snapshots` (\n\t`id` int AUTO_INCREMENT NOT NULL,\n\t`tournamentId` int NOT NULL,\n\t`snapshotTime` timestamp NOT NULL DEFAULT (now()),\n\t`topPlayers` json,\n\tCONSTRAINT `tournament_snapshots_id` PRIMARY KEY(`id`)\n);\nCREATE TABLE `tournaments` (\n\t`id` int AUTO_INCREMENT NOT NULL,\n\t`name` varchar(255) NOT NULL,\n\t`description` text,\n\t`gameId` int,\n\t`status` enum('upcoming','active','completed','cancelled') NOT NULL DEFAULT 'upcoming',\n\t`startAt` timestamp NOT NULL,\n\t`endAt` timestamp NOT NULL,\n\t`entryFeeGc` int NOT NULL DEFAULT 0,\n\t`maxParticipants` int,\n\t`currentParticipants` int NOT NULL DEFAULT 0,\n\t`prizePool` decimal(15,2) NOT NULL DEFAULT '0.00',\n\t`prizeDistribution` json,\n\t`leaderboardId` int,\n\t`createdBy` int NOT NULL,\n\t`createdAt` timestamp NOT NULL DEFAULT (now()),\n\t`updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,\n\tCONSTRAINT `tournaments_id` PRIMARY KEY(`id`)\n);\nCREATE TABLE `user_vip_status` (\n\t`id` int AUTO_INCREMENT NOT NULL,\n\t`userId` int NOT NULL,\n\t`currentVipTierId` int,\n\t`lifetimeWinnings` decimal(15,2) NOT NULL DEFAULT '0.00',\n\t`totalBetsPlaced` decimal(15,2) NOT NULL DEFAULT '0.00',\n\t`weeklyBonusClaimedAt` timestamp,\n\t`monthlyBonusClaimedAt` timestamp,\n\t`lastVipUpgradeAt` timestamp,\n\t`updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,\n\t`createdAt` timestamp NOT NULL DEFAULT (now()),\n\tCONSTRAINT `user_vip_status_id` PRIMARY KEY(`id`),\n\tCONSTRAINT `user_vip_status_userId_unique` UNIQUE(`userId`)\n);\nCREATE TABLE `vip_tiers` (\n\t`id` int AUTO_INCREMENT NOT NULL,\n\t`name` varchar(64) NOT NULL,\n\t`minLifetimeWinnings` decimal(15,2) NOT NULL,\n\t`bonusMultiplier` decimal(3,2) NOT NULL DEFAULT '1.00',\n\t`weeklyBonusGc` int NOT NULL DEFAULT 0,\n\t`monthlyBonusGc` int NOT NULL DEFAULT 0,\n\t`exclusiveGames` json,\n\t`prioritySupport` boolean NOT NULL DEFAULT false,\n\t`customAvatarFrame` boolean NOT NULL DEFAULT false,\n\t`badgeIcon` text,\n\t`description` text,\n\t`createdAt` timestamp NOT NULL DEFAULT (now()),\n\tCONSTRAINT `vip_tiers_id` PRIMARY KEY(`id`)\n);\nCREATE INDEX `idx_leaderboard_type` ON `leaderboards` (`leaderboardType`);\nCREATE INDEX `idx_leaderboard_userId` ON `leaderboards` (`userId`);\nCREATE INDEX `idx_leaderboard_gameId` ON `leaderboards` (`gameId`);\nCREATE INDEX `idx_tournament_participants_tournamentId` ON `tournament_participants` (`tournamentId`);\nCREATE INDEX `idx_tournament_participants_userId` ON `tournament_participants` (`userId`);\nCREATE INDEX `idx_tournament_snapshots_tournamentId` ON `tournament_snapshots` (`tournamentId`);\nCREATE INDEX `idx_tournament_status` ON `tournaments` (`status`);\nCREATE INDEX `idx_tournament_gameId` ON `tournaments` (`gameId`);\nCREATE INDEX `idx_tournament_startAt` ON `tournaments` (`startAt`);\nCREATE INDEX `idx_user_vip_userId` ON `user_vip_status` (`userId`);\nCREATE INDEX `idx_vip_tier_minWinnings` ON `vip_tiers` (`minLifetimeWinnings`);",
  "command": "mysql --batch --raw --column-names --default-character-set=utf8mb4 --host gateway04.us-east-1.prod.aws.tidbcloud.com --port 4000 --user 3sE2opaakiHhpCk.root --database 38mmEpDjJeLLr6ocaGW5p5 --execute CREATE TABLE `leaderboards` (\n\t`id` int AUTO_INCREMENT NOT NULL,\n\t`userId` int NOT NULL,\n\t`leaderboardType` enum('global','weekly','daily','game_specific') NOT NULL,\n\t`gameId` int,\n\t`totalWinnings` decimal(15,2) NOT NULL DEFAULT '0.00',\n\t`totalBets` decimal(15,2) NOT NULL DEFAULT '0.00',\n\t`winCount` int NOT NULL DEFAULT 0,\n\t`rank` int NOT NULL DEFAULT 0,\n\t`period` varchar(20),\n\t`updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,\n\t`createdAt` timestamp NOT NULL DEFAULT (now()),\n\tCONSTRAINT `leaderboards_id` PRIMARY KEY(`id`)\n);\nCREATE TABLE `tournament_participants` (\n\t`id` int AUTO_INCREMENT NOT NULL,\n\t`tournamentId` int NOT NULL,\n\t`userId` int NOT NULL,\n\t`score` decimal(15,2) NOT NULL DEFAULT '0.00',\n\t`finalRank` int,\n\t`prizeWon` decimal(15,2) DEFAULT '0.00',\n\t`joinedAt` timestamp NOT NULL DEFAULT (now()),\n\t`completedAt` timestamp,\n\tCONSTRAINT `tournament_participants_id` PRIMARY KEY(`id`)\n);\nCREATE TABLE `tournament_snapshots` (\n\t`id` int AUTO_INCREMENT NOT NULL,\n\t`tournamentId` int NOT NULL,\n\t`snapshotTime` timestamp NOT NULL DEFAULT (now()),\n\t`topPlayers` json,\n\tCONSTRAINT `tournament_snapshots_id` PRIMARY KEY(`id`)\n);\nCREATE TABLE `tournaments` (\n\t`id` int AUTO_INCREMENT NOT NULL,\n\t`name` varchar(255) NOT NULL,\n\t`description` text,\n\t`gameId` int,\n\t`status` enum('upcoming','active','completed','cancelled') NOT NULL DEFAULT 'upcoming',\n\t`startAt` timestamp NOT NULL,\n\t`endAt` timestamp NOT NULL,\n\t`entryFeeGc` int NOT NULL DEFAULT 0,\n\t`maxParticipants` int,\n\t`currentParticipants` int NOT NULL DEFAULT 0,\n\t`prizePool` decimal(15,2) NOT NULL DEFAULT '0.00',\n\t`prizeDistribution` json,\n\t`leaderboardId` int,\n\t`createdBy` int NOT NULL,\n\t`createdAt` timestamp NOT NULL DEFAULT (now()),\n\t`updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,\n\tCONSTRAINT `tournaments_id` PRIMARY KEY(`id`)\n);\nCREATE TABLE `user_vip_status` (\n\t`id` int AUTO_INCREMENT NOT NULL,\n\t`userId` int NOT NULL,\n\t`currentVipTierId` int,\n\t`lifetimeWinnings` decimal(15,2) NOT NULL DEFAULT '0.00',\n\t`totalBetsPlaced` decimal(15,2) NOT NULL DEFAULT '0.00',\n\t`weeklyBonusClaimedAt` timestamp,\n\t`monthlyBonusClaimedAt` timestamp,\n\t`lastVipUpgradeAt` timestamp,\n\t`updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,\n\t`createdAt` timestamp NOT NULL DEFAULT (now()),\n\tCONSTRAINT `user_vip_status_id` PRIMARY KEY(`id`),\n\tCONSTRAINT `user_vip_status_userId_unique` UNIQUE(`userId`)\n);\nCREATE TABLE `vip_tiers` (\n\t`id` int AUTO_INCREMENT NOT NULL,\n\t`name` varchar(64) NOT NULL,\n\t`minLifetimeWinnings` decimal(15,2) NOT NULL,\n\t`bonusMultiplier` decimal(3,2) NOT NULL DEFAULT '1.00',\n\t`weeklyBonusGc` int NOT NULL DEFAULT 0,\n\t`monthlyBonusGc` int NOT NULL DEFAULT 0,\n\t`exclusiveGames` json,\n\t`prioritySupport` boolean NOT NULL DEFAULT false,\n\t`customAvatarFrame` boolean NOT NULL DEFAULT false,\n\t`badgeIcon` text,\n\t`description` text,\n\t`createdAt` timestamp NOT NULL DEFAULT (now()),\n\tCONSTRAINT `vip_tiers_id` PRIMARY KEY(`id`)\n);\nCREATE INDEX `idx_leaderboard_type` ON `leaderboards` (`leaderboardType`);\nCREATE INDEX `idx_leaderboard_userId` ON `leaderboards` (`userId`);\nCREATE INDEX `idx_leaderboard_gameId` ON `leaderboards` (`gameId`);\nCREATE INDEX `idx_tournament_participants_tournamentId` ON `tournament_participants` (`tournamentId`);\nCREATE INDEX `idx_tournament_participants_userId` ON `tournament_participants` (`userId`);\nCREATE INDEX `idx_tournament_snapshots_tournamentId` ON `tournament_snapshots` (`tournamentId`);\nCREATE INDEX `idx_tournament_status` ON `tournaments` (`status`);\nCREATE INDEX `idx_tournament_gameId` ON `tournaments` (`gameId`);\nCREATE INDEX `idx_tournament_startAt` ON `tournaments` (`startAt`);\nCREATE INDEX `idx_user_vip_userId` ON `user_vip_status` (`userId`);\nCREATE INDEX `idx_vip_tier_minWinnings` ON `vip_tiers` (`minLifetimeWinnings`);",
  "rows": [],
  "messages": [],
  "stdout": "",
  "stderr": "",
  "execution_time_ms": 7348
}