-- Adminer 4.0.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 `glossary_words`;
CREATE TABLE `glossary_words` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `show` tinyint(1) NOT NULL,
  `mainphoto` int(11) DEFAULT NULL,
  `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `mainphoto` (`mainphoto`),
  CONSTRAINT `glossary_words_ibfk_1` FOREIGN KEY (`mainphoto`) REFERENCES `photos` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


DROP TABLE IF EXISTS `glossary_words_contents`;
CREATE TABLE `glossary_words_contents` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `word` int(11) NOT NULL,
  `language` int(11) NOT NULL,
  `start_char` char(1) NOT NULL,
  `title` varchar(255) NOT NULL,
  `perex` text NOT NULL,
  `content` text NOT NULL,
  `relations` text NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `word_language` (`word`,`language`),
  UNIQUE KEY `language_title` (`language`,`title`),
  KEY `title` (`title`),
  KEY `start_char` (`start_char`),
  CONSTRAINT `glossary_words_contents_ibfk_1` FOREIGN KEY (`word`) REFERENCES `glossary_words` (`id`) ON DELETE CASCADE,
  CONSTRAINT `glossary_words_contents_ibfk_2` FOREIGN KEY (`language`) REFERENCES `languages` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


-- 2014-01-16 11:00:01
