-- Adminer 3.7.1 MySQL dump

SET NAMES utf8;
SET foreign_key_checks = 0;
SET time_zone = '+01:00';
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';

DROP TABLE IF EXISTS `maps`;
CREATE TABLE `maps` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `lat` varchar(40) NOT NULL,
  `lng` varchar(40) NOT NULL,
  `zoom` varchar(40) NOT NULL,
  `autofit` tinyint(1) NOT NULL DEFAULT '0',
  `type` enum('ROADMAP','SATELLITE','HYBRID','TERRAIN') NOT NULL,
  `type_position` enum('NONE','TOP_LEFT','LEFT_CENTER','BOTTOM_LEFT','TOP_CENTER','BOTTOM_CENTER','TOP_RIGHT','RIGHT_CENTER','BOTTOM_RIGHT') NOT NULL,
  `zoom_position` enum('NONE','TOP_LEFT','LEFT_CENTER','BOTTOM_LEFT','TOP_CENTER','BOTTOM_CENTER','TOP_RIGHT','RIGHT_CENTER','BOTTOM_RIGHT') NOT NULL,
  `pan_position` enum('NONE','TOP_LEFT','LEFT_CENTER','BOTTOM_LEFT','TOP_CENTER','BOTTOM_CENTER','TOP_RIGHT','RIGHT_CENTER','BOTTOM_RIGHT') NOT NULL,
  `streetview_position` enum('NONE','TOP_LEFT','LEFT_CENTER','BOTTOM_LEFT','TOP_CENTER','BOTTOM_CENTER','TOP_RIGHT','RIGHT_CENTER','BOTTOM_RIGHT') NOT NULL,
  `color` enum('COLOR','BW') NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


DROP TABLE IF EXISTS `maps_markers`;
CREATE TABLE `maps_markers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `map` int(11) NOT NULL,
  `lat` varchar(40) DEFAULT NULL,
  `lng` varchar(40) DEFAULT NULL,
  `polygon` text,
  `polygon_color` char(7) DEFAULT NULL,
  `polygon_opacity` char(7) DEFAULT NULL,
  `icon` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `map` (`map`),
  KEY `icon` (`icon`),
  CONSTRAINT `maps_markers_ibfk_1` FOREIGN KEY (`map`) REFERENCES `maps` (`id`) ON DELETE CASCADE,
  CONSTRAINT `maps_markers_ibfk_2` FOREIGN KEY (`icon`) REFERENCES `photos` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


DROP TABLE IF EXISTS `maps_markers_contents`;
CREATE TABLE `maps_markers_contents` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `marker` int(11) NOT NULL,
  `language` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `content` text NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `marker_language` (`marker`,`language`),
  KEY `language` (`language`),
  CONSTRAINT `maps_markers_contents_ibfk_1` FOREIGN KEY (`marker`) REFERENCES `maps_markers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `maps_markers_contents_ibfk_2` FOREIGN KEY (`language`) REFERENCES `languages` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


-- 2013-12-29 10:36:22
