-- phpMyAdmin SQL Dump
-- version 4.0.4.1
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Temps de generació: 12-06-2014 a les 02:13:53
-- Versió del servidor: 5.6.12
-- Versió de PHP: 5.5.0

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

--
-- Base de dades: `open_data`
--
CREATE DATABASE IF NOT EXISTS `open_data` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `open_data`;

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

--
-- Estructura de la taula `categories`
--

CREATE TABLE IF NOT EXISTS `categories` (
  `id` int(11) NOT NULL,
  `nameEng` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
  `nameCat` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
  `nameSpa` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Bolcant dades de la taula `categories`
--

INSERT INTO `categories` (`id`, `nameEng`, `nameCat`, `nameSpa`) VALUES
(2, 'Pictures', 'Imatges', 'Imágenes'),
(1, 'Administration', 'Administració', 'Administración'),
(3, 'Maps', 'Mapes', 'Mapas'),
(4, 'Events', 'Esdeveniments', 'Eventos');

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

--
-- Estructura de la taula `data`
--

CREATE TABLE IF NOT EXISTS `data` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idCategory` int(11) NOT NULL,
  `idUser` int(11) NOT NULL,
  `file` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `web` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `type` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `size` decimal(10,0) NOT NULL,
  `dateTime` datetime NOT NULL,
  `nameEng` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `nameCat` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `nameSpa` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `message` varchar(500) COLLATE utf8_unicode_ci NOT NULL,
  `metadata` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
  `views` int(11) NOT NULL,
  `accepted` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`),
  KEY `idCategory` (`idCategory`),
  KEY `idCategory_2` (`idCategory`),
  KEY `idUser` (`idUser`),
  KEY `idCategory_3` (`idCategory`),
  KEY `idUser_2` (`idUser`),
  KEY `idCategory_4` (`idCategory`),
  KEY `idUser_3` (`idUser`),
  KEY `idCategory_5` (`idCategory`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=21 ;

--
-- Bolcant dades de la taula `data`
--

INSERT INTO `data` (`id`, `idCategory`, `idUser`, `file`, `web`, `type`, `size`, `dateTime`, `nameEng`, `nameCat`, `nameSpa`, `message`, `metadata`, `views`, `accepted`) VALUES
(18, 1, 15, '80685-test.xls', '', 'XLS', '16', '2014-05-14 12:27:50', 'Example XLS Administration', '', '', 'Example XLS Administration', 'administration, excel', 0, 1),
(19, 3, 16, '69298-1184612456_f.jpg', '', 'JPG', '41296', '2014-05-14 13:37:10', 'School team', '', '', 'School team of Barcelona', 'school, football, team, barcelona', 15, 1),
(16, 2, 7, '73846-IMG_0529.JPG', '', 'JPG', '1384736', '2014-05-13 01:28:15', 'Example 1', '', '', 'Test 1', '', 1, 1),
(15, 2, 7, '41228-IMG_0529.JPG', '', 'JPG', '1384736', '2014-05-13 01:27:48', 'Example 2', '', '', 'Test 2', '', 0, 1),
(14, 2, 7, '86580-IMG_0529.JPG', '', 'JPG', '1384736', '2014-05-13 01:26:27', 'Example 3', '', '', 'Test 3', '', 2, 1),
(20, 2, 7, '28665-Imagen103.jpg', '', 'JPG', '237848', '2014-06-06 20:22:40', 'Test Picture', '', '', 'Test Picture', '', 0, 0);

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

--
-- Estructura de la taula `events`
--

CREATE TABLE IF NOT EXISTS `events` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idUser` int(11) NOT NULL,
  `titleEng` varchar(100) NOT NULL,
  `titleCat` varchar(100) NOT NULL,
  `titleSpa` varchar(100) NOT NULL,
  `organiser` varchar(255) NOT NULL,
  `date` varchar(100) NOT NULL,
  `place` varchar(255) NOT NULL,
  `link` varchar(500) NOT NULL,
  `description` varchar(500) NOT NULL,
  `dateTime` datetime NOT NULL,
  `views` int(11) NOT NULL,
  `accepted` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idUser` (`idUser`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;

--
-- Bolcant dades de la taula `events`
--

INSERT INTO `events` (`id`, `idUser`, `titleEng`, `titleCat`, `titleSpa`, `organiser`, `date`, `place`, `link`, `description`, `dateTime`, `views`, `accepted`) VALUES
(4, 7, 'Test Event', '', '', 'UB', '26.06.2014', 'Barcelona', 'www.ub.edu', 'Description Test', '2014-05-15 01:54:47', 12, 1);

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

--
-- Estructura de la taula `users`
--

CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `email` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `firstName` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `lastName` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `dateTime` datetime NOT NULL,
  `lastConnection` datetime NOT NULL,
  `note` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
  `active` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=19 ;

--
-- Bolcant dades de la taula `users`
--

INSERT INTO `users` (`id`, `email`, `password`, `firstName`, `lastName`, `dateTime`, `lastConnection`, `note`, `active`) VALUES
(7, 'jordixaubet@gmail.com', 'JOWZthDW4V7BY+d21XS0Hq8l+70S6+SJjkqfhyY+9MDzifWc8CnTAdeZtHUWph8YiTolgmhyAktvZWagcX9zHg==', 'Jordi', 'XP', '2014-05-11 22:02:45', '2014-06-12 02:06:27', NULL, 1),
(16, 'mira.trebar@fri.uni-lj.si', 'KJb/VSIgcr1MeFLgm9FkChS4IBOgc7B7NSqtZJYxbRTuMfWGgKa0QNjAp2JvFbOR87P9e39T4UDz7laF2fcJlQ==', 'Mira', 'Trebar', '2014-05-14 13:27:21', '2014-05-14 13:27:21', NULL, 1);

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