CREATE TABLE IF NOT EXISTS `typ_webmenu` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `nazov` varchar(255) DEFAULT NULL,
  `code` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `webmenu` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `typ_webmenu_id` int(11) unsigned NOT NULL,
  `webmenu_id` int(11) unsigned DEFAULT NULL,
  `web_nazov` varchar(255) DEFAULT NULL,
  `nazov` varchar(255) DEFAULT NULL,
  `code` varchar(255) DEFAULT NULL,
  `seonazov` varchar(255) DEFAULT NULL,
  `poradie` int(11) unsigned DEFAULT NULL,
  `visibility_type` tinyint(1) unsigned DEFAULT NULL,
  `target` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `webmenu_id` (`webmenu_id`),
  KEY `typ_webmenu_id` (`typ_webmenu_id`),
  CONSTRAINT `webmenu_ibfk_1` FOREIGN KEY (`webmenu_id`) REFERENCES `webmenu` (`id`),
  CONSTRAINT `webmenu_ibfk_2` FOREIGN KEY (`typ_webmenu_id`) REFERENCES `typ_webmenu` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;