-- phpMyAdmin SQL Dump
-- version 4.1.12
-- http://www.phpmyadmin.net
--
-- Host: localhost:8889
-- Generation Time: Lug 15, 2014 alle 09:09
-- Versione del server: 5.5.34
-- PHP Version: 5.5.10

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

--
-- Database: `ristomeal`
--

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

--
-- Struttura della tabella `dish`
--

CREATE TABLE `dish` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `type` int(11) NOT NULL,
  `description` text NOT NULL,
  `kcal` int(11) NOT NULL,
  `price` varchar(8) NOT NULL,
  `people` varchar(4) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ;

--
-- Dump dei dati per la tabella `dish`
--

INSERT INTO `dish` (`id`, `name`, `type`, `description`, `kcal`, `price`, `people`) VALUES
(9, 'Colazione continentale', 5, 'Classica colazione continentale', 0, '4', '1'),
(10, 'Pizza margherita', 5, '', 0, '7', '1'),
(11, 'Profitterol', 4, '', 0, '5', '1'),
(13, 'Pasta alla carbonara', 2, '', 0, '8', '4');

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

--
-- Struttura della tabella `dish_ingredient`
--

CREATE TABLE `dish_ingredient` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `dish_id` int(11) NOT NULL,
  `ingredient_id` int(11) NOT NULL,
  `quantity` varchar(8) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=34 ;

--
-- Dump dei dati per la tabella `dish_ingredient`
--

INSERT INTO `dish_ingredient` (`id`, `dish_id`, `ingredient_id`, `quantity`) VALUES
(19, 9, 11, ''),
(20, 9, 10, ''),
(21, 10, 6, ''),
(22, 10, 7, ''),
(25, 11, 12, '3'),
(30, 13, 3, '150'),
(31, 13, 5, '100'),
(32, 13, 1, '350'),
(33, 13, 4, '3');

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

--
-- Struttura della tabella `dish_type`
--

CREATE TABLE `dish_type` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(32) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;

--
-- Dump dei dati per la tabella `dish_type`
--

INSERT INTO `dish_type` (`id`, `type`) VALUES
(1, 'Starters'),
(2, 'First'),
(3, 'Second'),
(4, 'Sweet'),
(5, 'Other'),
(6, 'Wine');

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

--
-- Struttura della tabella `ingredient`
--

CREATE TABLE `ingredient` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `measure` varchar(8) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ;

--
-- Dump dei dati per la tabella `ingredient`
--

INSERT INTO `ingredient` (`id`, `name`, `measure`) VALUES
(1, 'Spaghetti', '1'),
(3, 'Guanciale', '1'),
(4, 'Uovo', '2'),
(5, 'Pecorino', '1'),
(6, 'Mozzarella', '1'),
(7, 'Pomodoro', '1'),
(8, 'Prosecco', '3'),
(9, 'Barbera', '3'),
(10, 'Cappuccio', '2'),
(11, 'Bacon', '1'),
(12, 'Profitterol', '2'),
(13, 'Zucchine', '1');

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

--
-- Struttura della tabella `meal`
--

CREATE TABLE `meal` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `description` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Struttura della tabella `meal_dish`
--

CREATE TABLE `meal_dish` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `meal_id` int(11) NOT NULL,
  `dish_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Struttura della tabella `measure_type`
--

CREATE TABLE `measure_type` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(32) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

--
-- Dump dei dati per la tabella `measure_type`
--

INSERT INTO `measure_type` (`id`, `name`) VALUES
(1, 'gr'),
(2, 'pezzi'),
(3, 'ml');

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

--
-- Struttura della tabella `menu`
--

CREATE TABLE `menu` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `type` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `title` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `starter_name` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `first_name` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `second_name` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `sweet_name` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `other_name` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `wine_name` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `starter_array` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `first_array` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `second_array` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `sweet_array` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `other_array` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `wine_array` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;

--
-- Dump dei dati per la tabella `menu`
--

INSERT INTO `menu` (`id`, `date`, `type`, `title`, `starter_name`, `first_name`, `second_name`, `sweet_name`, `other_name`, `wine_name`, `starter_array`, `first_array`, `second_array`, `sweet_array`, `other_array`, `wine_array`) VALUES
(6, '2014/07/11', '1', 'Colazione standard', 'Starter', 'First', 'Second', 'Sweet', 'Other', 'Wine', 'false', 'false', 'false', 'false', '["9"]', 'false'),
(8, '2014/07/11', '3', 'Serata napoletana', 'Starter', 'First', 'Second', 'Sweet', 'Other', 'Wine', 'false', '["10"]', 'false', '["11"]', 'false', 'false'),
(10, '2014/07/11', '2', 'Pranzo tipico', 'Starter', 'First', 'Second', 'Sweet', 'Other', 'Wine', 'false', '["13"]', 'false', 'false', 'false', 'false');

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

--
-- Struttura della tabella `template`
--

CREATE TABLE `template` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` int(11) NOT NULL,
  `name` text NOT NULL,
  `code` text NOT NULL,
  `description` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

--
-- Dump dei dati per la tabella `template`
--

INSERT INTO `template` (`id`, `type`, `name`, `code`, `description`) VALUES
(1, 1, 'Template1Day', '1day', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi congue ullamcorper augue, id ultricies turpis egestas id. Donec eu dictum lacus, vel volutpat risus.'),
(2, 1, 'Template2Day', '2day', 'Sed imperdiet lobortis lorem, id feugiat diam rhoncus at. Aenean eu lectus id quam lobortis tincidunt. Pellentesque varius augue in congue egestas.'),
(3, 2, 'Template1Single', '1single', 'Sed imperdiet lobortis lorem, id feugiat diam rhoncus at. Aenean eu lectus id quam lobortis tincidunt. Pellentesque varius augue in congue egestas.'),
(4, 2, 'Template2Single', '2single', 'Sed imperdiet lobortis lorem, id feugiat diam rhoncus at. Aenean eu lectus id quam lobortis tincidunt. Pellentesque varius augue in congue egestas.');

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

--
-- Struttura della tabella `user`
--

CREATE TABLE `user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(32) NOT NULL,
  `password` varchar(32) NOT NULL,
  `type` int(11) NOT NULL,
  `templateSingle` int(11) NOT NULL,
  `templateDay` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

--
-- Dump dei dati per la tabella `user`
--

INSERT INTO `user` (`id`, `username`, `password`, `type`, `templateSingle`, `templateDay`) VALUES
(1, 'admin', '0cc175b9c0f1b6a831c399e269772661', 1, 4, 2);

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

--
-- Struttura della tabella `user_type`
--

CREATE TABLE `user_type` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dump dei dati per la tabella `user_type`
--

INSERT INTO `user_type` (`id`, `name`) VALUES
(1, 'Admin'),
(2, 'Cook');
