-- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jan 04, 2022 at 12:14 AM
-- Server version: 10.5.12-MariaDB-cll-lve
-- PHP Version: 7.2.34

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

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

--
-- Table structure for table `boards`
--

CREATE TABLE `boards` (
  `boardid` char(17) COLLATE utf8mb4_unicode_ci NOT NULL,
  `motorpower` int(11) DEFAULT NULL,
  `lastcall` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Motorpower should be subclassed to another table but I was lazy

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

--
-- Table structure for table `bulb`
--

CREATE TABLE `bulb` (
  `boardid` char(17) COLLATE utf8mb4_unicode_ci NOT NULL,
  `mappedto` char(17) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--

--
-- Table structure for table `lcddisplay`
--

CREATE TABLE `lcddisplay` (
  `boardid` char(17) COLLATE utf8mb4_unicode_ci NOT NULL,
  `displayrow` int(1) NOT NULL,
  `displaytext` varchar(17) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Table structure for table `switches`
--

CREATE TABLE `switches` (
  `board` char(17) COLLATE utf8mb4_unicode_ci NOT NULL,
  `switchstate` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


--
-- Table structure for table `temperature`
--

CREATE TABLE `temperature` (
  `boardid` char(17) COLLATE utf8mb4_unicode_ci NOT NULL,
  `enterdate` date NOT NULL,
  `entertime` time NOT NULL,
  `tempinc` float NOT NULL,
  `tempinf` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `boards`
--
ALTER TABLE `boards`
  ADD PRIMARY KEY (`boardid`);

--
-- Indexes for table `bulb`
--
ALTER TABLE `bulb`
  ADD PRIMARY KEY (`boardid`);

--
-- Indexes for table `lcddisplay`
--
ALTER TABLE `lcddisplay`
  ADD PRIMARY KEY (`boardid`,`displayrow`);

--
-- Indexes for table `researchboards`
--
ALTER TABLE `researchboards`
  ADD PRIMARY KEY (`boardid`);

--
-- Indexes for table `researchnetworks`
--
ALTER TABLE `researchnetworks`
  ADD PRIMARY KEY (`boardid`,`network`);

--
-- Indexes for table `switches`
--
ALTER TABLE `switches`
  ADD PRIMARY KEY (`board`);

--
-- Indexes for table `temperature`
--
ALTER TABLE `temperature`
  ADD PRIMARY KEY (`boardid`,`enterdate`,`entertime`);
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 */;
