-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Počítač: 127.0.0.1
-- Vytvořeno: Ned 21. kvě 2017, 20:13
-- Verze serveru: 5.7.14
-- Verze PHP: 7.0.10

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

--
-- Databáze: `pmcu`
--

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

--
-- Struktura tabulky `configuration`
--

CREATE TABLE `configuration` (
  `sensor_id` int(11) NOT NULL,
  `name` varchar(125) DEFAULT NULL,
  `relay_1` tinyint(1) NOT NULL,
  `relay_2` tinyint(1) NOT NULL,
  `commode` tinyint(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Struktura tabulky `received_data`
--

CREATE TABLE `received_data` (
  `id` int(10) UNSIGNED NOT NULL,
  `sensor_id` int(10) UNSIGNED NOT NULL,
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `tmp` int(11) NOT NULL,
  `hum` int(10) UNSIGNED NOT NULL,
  `vltg` int(10) UNSIGNED NOT NULL,
  `rssi` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Struktura tabulky `registermode`
--

CREATE TABLE `registermode` (
  `registermode` tinyint(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Vypisuji data pro tabulku `registermode`
--

INSERT INTO `registermode` (`registermode`) VALUES
(0);

--
-- Klíče pro exportované tabulky
--

--
-- Klíče pro tabulku `configuration`
--
ALTER TABLE `configuration`
  ADD PRIMARY KEY (`sensor_id`);

--
-- Klíče pro tabulku `received_data`
--
ALTER TABLE `received_data`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT pro tabulky
--

--
-- AUTO_INCREMENT pro tabulku `received_data`
--
ALTER TABLE `received_data`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
/*!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 */;
