-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Sep 05, 2019 at 09:42 AM
-- Server version: 10.3.17-MariaDB-0ubuntu0.19.04.1
-- PHP Version: 7.2.19-0ubuntu0.19.04.2

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
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: `teribear`
--

-- --------------------------------------------------------

--
-- Table structure for table `Import`
--

CREATE TABLE `Import` (
  `Id` int(11) NOT NULL,
  `Time` datetime NOT NULL,
  `Hash` varchar(255) NOT NULL,
  `ItemCount` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- --------------------------------------------------------

--
-- Table structure for table `Runner`
--

CREATE TABLE `Runner` (
  `Id` int(11) NOT NULL,
  `Name` varchar(255) NOT NULL,
  `Gender` int(11) NOT NULL,
  `Team` int(11) DEFAULT NULL,
  `ChipNumber` int(11) NOT NULL,
  `Year` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;

-- --------------------------------------------------------

--
-- Table structure for table `RunnerStat`
--

CREATE TABLE `RunnerStat` (
  `Id` int(11) NOT NULL,
  `Time` datetime NOT NULL,
  `Runner` int(11) NOT NULL,
  `Distance` decimal(10,1) NOT NULL,
  `Rank` int(11) NOT NULL,
  `Money` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;

-- --------------------------------------------------------

--
-- Table structure for table `Team`
--

CREATE TABLE `Team` (
  `Id` int(11) NOT NULL,
  `Name` varchar(255) NOT NULL,
  `WebId` int(11) NOT NULL,
  `IsFamily` int(11) NOT NULL,
  `Year` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;

-- --------------------------------------------------------

--
-- Table structure for table `TeamStat`
--

CREATE TABLE `TeamStat` (
  `Id` int(11) NOT NULL,
  `Time` datetime NOT NULL,
  `Team` int(11) NOT NULL,
  `Distance` decimal(10,1) NOT NULL,
  `Rank` int(11) NOT NULL,
  `Money` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `Import`
--
ALTER TABLE `Import`
  ADD PRIMARY KEY (`Id`);

--
-- Indexes for table `Runner`
--
ALTER TABLE `Runner`
  ADD PRIMARY KEY (`Id`),
  ADD KEY `Team` (`Team`);

--
-- Indexes for table `RunnerStat`
--
ALTER TABLE `RunnerStat`
  ADD PRIMARY KEY (`Id`),
  ADD KEY `Runner` (`Runner`);

--
-- Indexes for table `Team`
--
ALTER TABLE `Team`
  ADD PRIMARY KEY (`Id`);

--
-- Indexes for table `TeamStat`
--
ALTER TABLE `TeamStat`
  ADD PRIMARY KEY (`Id`),
  ADD KEY `Team` (`Team`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `Import`
--
ALTER TABLE `Import`
  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `Runner`
--
ALTER TABLE `Runner`
  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31205;
--
-- AUTO_INCREMENT for table `RunnerStat`
--
ALTER TABLE `RunnerStat`
  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=250219;
--
-- AUTO_INCREMENT for table `Team`
--
ALTER TABLE `Team`
  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12718;
--
-- AUTO_INCREMENT for table `TeamStat`
--
ALTER TABLE `TeamStat`
  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=55625;
--
-- Constraints for dumped tables
--

--
-- Constraints for table `Runner`
--
ALTER TABLE `Runner`
  ADD CONSTRAINT `Runner_ibfk_1` FOREIGN KEY (`Team`) REFERENCES `Team` (`Id`);

--
-- Constraints for table `RunnerStat`
--
ALTER TABLE `RunnerStat`
  ADD CONSTRAINT `RunnerStat_ibfk_1` FOREIGN KEY (`Runner`) REFERENCES `Runner` (`Id`);

--
-- Constraints for table `TeamStat`
--
ALTER TABLE `TeamStat`
  ADD CONSTRAINT `TeamStat_ibfk_1` FOREIGN KEY (`Team`) REFERENCES `Team` (`Id`);

/*!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 */;
