

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

-- 
-- Структура таблицы `comment_comment`
-- 

CREATE TABLE `comment_comment` (
  `id` int(11) NOT NULL auto_increment,
  `user_id` int(11) default NULL,
  `parent_id` int(11) default NULL,
  `message` varchar(1000) default NULL,
  `time_added` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  PRIMARY KEY  (`id`),
  KEY `user_id` (`user_id`),
  KEY `parent_id` (`parent_id`)
) ENGINE=InnoDB AUTO_INCREMENT=157 DEFAULT CHARSET=cp1251 AUTO_INCREMENT=157 ;

-- 
-- Дамп данных таблицы `comment_comment`
-- 

INSERT INTO `comment_comment` VALUES (123, 1, NULL, 'fds', '2013-11-23 17:59:02');
INSERT INTO `comment_comment` VALUES (134, 2, NULL, 'sdf', '2014-01-19 17:13:16');
INSERT INTO `comment_comment` VALUES (135, 2, NULL, 'fsd', '2014-01-19 17:13:18');
INSERT INTO `comment_comment` VALUES (136, 2, NULL, 'fsd', '2014-01-19 17:13:18');
INSERT INTO `comment_comment` VALUES (141, 3, NULL, 'sdf', '2014-01-19 17:45:10');
INSERT INTO `comment_comment` VALUES (142, 3, NULL, 'sdf', '2014-01-19 17:45:10');
INSERT INTO `comment_comment` VALUES (143, 1, 142, 'reply 1', '2014-11-12 11:26:41');
INSERT INTO `comment_comment` VALUES (148, 1, 143, 'reply 2', '2014-11-12 12:27:08');
INSERT INTO `comment_comment` VALUES (149, 1, 148, 'reply 3', '2014-11-12 12:27:14');
INSERT INTO `comment_comment` VALUES (150, 1, 149, 'reply 4', '2014-11-12 12:27:24');
INSERT INTO `comment_comment` VALUES (151, 1, 143, 'reply 1 2', '2014-11-12 12:27:32');
INSERT INTO `comment_comment` VALUES (152, 1, NULL, 'fdsjkl', '2014-11-12 12:39:17');
INSERT INTO `comment_comment` VALUES (153, 1, NULL, 'fdsjkl', '2014-11-12 12:39:17');
INSERT INTO `comment_comment` VALUES (154, 2, NULL, 'fdsjkl', '2014-11-12 12:43:47');
INSERT INTO `comment_comment` VALUES (155, 2, NULL, 'fdsjkl', '2014-11-12 12:43:47');
INSERT INTO `comment_comment` VALUES (156, 2, 155, 'sfad', '2014-11-12 12:43:51');

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

-- 
-- Структура таблицы `guestBook_messages`
-- 

CREATE TABLE `guestBook_messages` (
  `id` int(11) NOT NULL auto_increment,
  `parent_id` int(11) default NULL,
  `username` char(100) default NULL,
  `message` varchar(1000) default NULL,
  `time_added` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  PRIMARY KEY  (`id`),
  KEY `parent_id` (`parent_id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=cp1251 AUTO_INCREMENT=13 ;

-- 
-- Дамп данных таблицы `guestBook_messages`
-- 

INSERT INTO `guestBook_messages` VALUES (4, NULL, 'fromDb', 'hello from db', '2013-11-08 16:16:14');
INSERT INTO `guestBook_messages` VALUES (6, NULL, 'user1', 'fdjskljkfds', '2013-11-24 15:42:59');
INSERT INTO `guestBook_messages` VALUES (9, 4, 'admin', 'sdf', '2013-12-02 18:41:17');
INSERT INTO `guestBook_messages` VALUES (10, NULL, 'guest username', 'message', '2014-11-12 11:25:09');
INSERT INTO `guestBook_messages` VALUES (12, 10, 'admin', 'reply message', '2014-11-12 11:26:22');

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

-- 
-- Структура таблицы `menu_menuitem`
-- 

CREATE TABLE `menu_menuitem` (
  `id` int(11) NOT NULL auto_increment,
  `parent_id` int(11) default NULL,
  `name` char(100) NOT NULL,
  `url` varchar(1000) default NULL,
  PRIMARY KEY  (`id`),
  KEY `parent_id` (`parent_id`)
) ENGINE=InnoDB AUTO_INCREMENT=169 DEFAULT CHARSET=cp1251 AUTO_INCREMENT=169 ;

-- 
-- Дамп данных таблицы `menu_menuitem`
-- 

INSERT INTO `menu_menuitem` VALUES (147, NULL, 'РљРѕРјРјРµРЅС‚Р°СЂРёРё', '/modules/comment/');
INSERT INTO `menu_menuitem` VALUES (148, NULL, 'Р“РѕСЃС‚РµРІР°СЏ РєРЅРёРіР°', '/modules/guestbook/');
INSERT INTO `menu_menuitem` VALUES (151, NULL, 'РњРµРЅСЋ', '/modules/menu/');
INSERT INTO `menu_menuitem` VALUES (152, NULL, 'Example', 'javascript:;');
INSERT INTO `menu_menuitem` VALUES (153, 152, 'submenu1', 'javascript:;');
INSERT INTO `menu_menuitem` VALUES (154, 152, 'submenu2', 'javascript:;');
INSERT INTO `menu_menuitem` VALUES (155, 152, 'submenu3', 'javascript:;');
INSERT INTO `menu_menuitem` VALUES (156, 152, 'submenu4', 'javascript:;');
INSERT INTO `menu_menuitem` VALUES (157, 152, 'submenu5', 'javascript:;');
INSERT INTO `menu_menuitem` VALUES (158, 155, 'subsubmenu1', 'javascript:;');
INSERT INTO `menu_menuitem` VALUES (159, 155, 'subsubmenu2', 'javascript:;');
INSERT INTO `menu_menuitem` VALUES (160, 155, 'subsubmenu3', 'javascript:;');
INSERT INTO `menu_menuitem` VALUES (161, 155, 'subsubmenu4', 'javascript:;');
INSERT INTO `menu_menuitem` VALUES (163, 154, 'subsubmenu1', 'javascript:;');
INSERT INTO `menu_menuitem` VALUES (164, 160, 'subsubsubmenu1', 'javascript:;');
INSERT INTO `menu_menuitem` VALUES (165, 160, 'subsubsubmenu2', 'javascript:;');
INSERT INTO `menu_menuitem` VALUES (166, 160, 'subsubsubmenu3', 'javascript:;');
INSERT INTO `menu_menuitem` VALUES (167, 154, 'subsubmenu2', 'javascript:;');
INSERT INTO `menu_menuitem` VALUES (168, 154, 'subsubmenu3', 'javascript:;');

-- 
-- Constraints for dumped tables
-- 

-- 
-- Constraints for table `comment_comment`
-- 
ALTER TABLE `comment_comment`
  ADD CONSTRAINT `comment_comment_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `auth_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `comment_comment_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `comment_comment` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- 
-- Constraints for table `guestBook_messages`
-- 
ALTER TABLE `guestBook_messages`
  ADD CONSTRAINT `guestbook_messages_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `guestbook_messages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- 
-- Constraints for table `menu_menuitem`
-- 
ALTER TABLE `menu_menuitem`
  ADD CONSTRAINT `menu_menuitem_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `menu_menuitem` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
        