-- phpMyAdmin SQL Dump
-- version 3.3.2deb1
-- http://www.phpmyadmin.net
--
-- Počítač: localhost
-- Vygenerováno: Čtvrtek 31. května 2012, 10:04
-- Verze MySQL: 5.1.41
-- Verze PHP: 5.3.2-1ubuntu4.10

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


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

--
-- Databáze: `rezny`
--

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

--
-- Struktura tabulky `buildings`
--

CREATE TABLE IF NOT EXISTS `buildings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(32) NOT NULL,
  `floors` int(11) NOT NULL,
  `mapname` varchar(16) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;

--
-- Vypisuji data pro tabulku `buildings`
--

INSERT INTO `buildings` (`id`, `name`, `floors`, `mapname`) VALUES
(1, 'VUT FEKT - Purkyňova 118', 7, 'fekt'),
(2, 'VUT FIT - areál Klášter', 4, 'fit1'),
(3, 'VUT FIT - Starý pivovar', 4, 'fit2');

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

--
-- Struktura tabulky `data`
--

CREATE TABLE IF NOT EXISTS `data` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `device` int(11) NOT NULL,
  `data` float DEFAULT NULL,
  `time` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=40398 ;


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

--
-- Struktura tabulky `devices`
--

CREATE TABLE IF NOT EXISTS `devices` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(32) NOT NULL,
  `type` varchar(32) NOT NULL,
  `sensor` int(11) NOT NULL,
  `icon` int(11) NOT NULL,
  `person` varchar(32) NOT NULL,
  `building` int(11) NOT NULL,
  `floor` int(11) NOT NULL,
  `room` varchar(11) NOT NULL,
  `loc_x` int(11) NOT NULL,
  `loc_y` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=15 ;

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

--
-- Struktura tabulky `icons`
--

CREATE TABLE IF NOT EXISTS `icons` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(32) NOT NULL,
  `picture` varchar(64) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=100 ;

--
-- Vypisuji data pro tabulku `icons`
--

INSERT INTO `icons` (`id`, `name`, `picture`) VALUES
(1, 'Konvice', 'konvice.png'),
(2, 'Lednička', 'lednicka.png'),
(3, 'Notebook', 'notebook.png'),
(4, 'Mikrovlnka', 'mikrovlnka.png'),
(5, 'PC', 'pc.png'),
(6, 'Router', 'router.png'),
(7, 'Osvětlení', 'svetlo.png'),
(99, 'Ostatní', 'ostatni.png');

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

--
-- Struktura tabulky `sensors`
--

CREATE TABLE IF NOT EXISTS `sensors` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `mac` varchar(32) NOT NULL,
  `active` tinyint(1) NOT NULL,
  `lastseen` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=15 ;

--
-- Vypisuji data pro tabulku `sensors`
--

INSERT INTO `sensors` (`id`, `mac`, `active`, `lastseen`) VALUES
(0, '', 0, 0);

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

--
-- Struktura tabulky `settings`
--

CREATE TABLE IF NOT EXISTS `settings` (
  `id` varchar(16) NOT NULL,
  `val` varchar(32) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Vypisuji data pro tabulku `settings`
--

INSERT INTO `settings` (`id`, `val`) VALUES
('password', '123456'),
('guest', '1'),
('refresh', '9999'),
('price', '4.5'),
('currency', 'Kč');

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

--
-- Struktura tabulky `temp`
--

CREATE TABLE IF NOT EXISTS `temp` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sensor` varchar(32) CHARACTER SET latin1 NOT NULL,
  `data` float DEFAULT NULL,
  `time` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=5879 ;


