structure with updates

main
Benjamin Kraft 3 months ago
parent 3abbb95484
commit cca1ae59ae
  1. 75
      structure.sql

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