diff --git a/structure.sql b/structure.sql index ec2ccc8..b0f9e6e 100644 --- a/structure.sql +++ b/structure.sql @@ -3,14 +3,20 @@ -- https://www.phpmyadmin.net/ -- -- Host: localhost --- Generation Time: Jun 13, 2024 at 01:45 AM --- Server version: 8.0.36-0ubuntu0.22.04.1 +-- Generation Time: Jun 15, 2024 at 11:21 PM +-- Server version: 8.0.37-0ubuntu0.22.04.3 -- PHP Version: 8.1.29 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; + +/*!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 */; +/*!40101 SET NAMES utf8mb4 */; + -- -- Database: `uem` -- @@ -21,12 +27,15 @@ SET time_zone = "+00:00"; -- Table structure for table `accounts` -- -CREATE TABLE `accounts` ( - `id` smallint NOT NULL, - `puuid` varchar(78) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL, - `gameName` varchar(32) NOT NULL, - `tagLine` varchar(16) NOT NULL, - `profileIconId` int NOT NULL DEFAULT '0' +CREATE TABLE IF NOT EXISTS `accounts` ( + `id` smallint NOT NULL AUTO_INCREMENT, + `puuid` varchar(78) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL, + `gameName` varchar(32) NOT NULL, + `tagLine` varchar(16) NOT NULL, + `profileIconId` int NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `RiotID` (`gameName`,`tagLine`) USING BTREE, + UNIQUE KEY `puuid` (`puuid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -------------------------------------------------------- @@ -35,42 +44,28 @@ CREATE TABLE `accounts` ( -- Table structure for table `elo_entries` -- -CREATE TABLE `elo_entries` ( - `accountId` smallint NOT NULL, - `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `tier` enum('IRON','BRONZE','SILVER','GOLD','PLATINUM','EMERALD','DIAMOND','MASTER','GRANDMASTER','CHALLENGER') NOT NULL, - `rank` enum('I','II','III','IV') NOT NULL, - `points` smallint NOT NULL +CREATE TABLE IF NOT EXISTS `elo_entries` ( + `accountId` smallint NOT NULL, + `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `tier` enum('IRON','BRONZE','SILVER','GOLD','PLATINUM','EMERALD','DIAMOND','MASTER','GRANDMASTER','CHALLENGER') NOT NULL, + `rank` enum('I','II','III','IV') NOT NULL, + `points` smallint NOT NULL, + PRIMARY KEY (`accountId`,`date`), + KEY `date` (`date`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; --- --- Indexes for dumped tables --- - --- --- Indexes for table `accounts` --- -ALTER TABLE `accounts` - ADD PRIMARY KEY (`id`), - ADD UNIQUE KEY `RiotID` (`gameName`,`tagLine`) USING BTREE, - ADD UNIQUE KEY `puuid` (`puuid`); - --- --- Indexes for table `elo_entries` --- -ALTER TABLE `elo_entries` - ADD PRIMARY KEY (`accountId`,`date`), - ADD KEY `date` (`date`); +-- -------------------------------------------------------- -- --- AUTO_INCREMENT for dumped tables +-- Table structure for table `updates` -- --- --- AUTO_INCREMENT for table `accounts` --- -ALTER TABLE `accounts` - MODIFY `id` smallint NOT NULL AUTO_INCREMENT; +CREATE TABLE IF NOT EXISTS `updates` ( + `id` int NOT NULL AUTO_INCREMENT, + `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `date` (`date`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Constraints for dumped tables @@ -82,3 +77,7 @@ ALTER TABLE `accounts` ALTER TABLE `elo_entries` ADD CONSTRAINT `elo_entries_ibfk_1` FOREIGN KEY (`accountId`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; COMMIT; + +/*!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 */; \ No newline at end of file