CREATE TABLE IF NOT EXISTS `news` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `msg` varchar(10024) DEFAULT NULL,
  `time` int(11) NOT NULL,
  `time_edit` int(11) not null,
  `title` varchar(250) DEFAULT NULL,
  `main_time` int(11) NOT NULL DEFAULT '0',
  `link` varchar(64) NOT NULL,
  `prosm` int(32) NOT NULL DEFAULT '0',
  `avtor` varchar(32) DEFAULT NULL,
  `avtor_edit` varchar(32) DEFAULT NULL,
  `tags` varchar(128) DEFAULT NULL,
  `close` enum('0','1') DEFAULT '0',
  `img` enum('0','1') DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `time` (`time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `news_like` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_user` int(11) NOT NULL,
  `id_news` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `news_komm` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_user` int(11) NOT NULL,
  `id_user_edit` varchar(32) DEFAULT NULL,
  `id_news` int(11) NOT NULL,
  `id_otvet` int(11) DEFAULT '0',
  `msg` varchar(10024) NOT NULL,
  `time` int(11) NOT NULL,
  `time_edit` int(11) not null,
  `rating` int(11) not null,
  `otvet` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `news_komm_like` (
  `id` int(11) not null auto_increment,
  `id_news` int(11) not null,
  `id_post` int(11) not null,
  `id_user` int(11) not null,
  `type` int(1) not null default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `news_hide` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nid` int(11) NOT NULL,
  `uid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

