CREATE TABLE IF NOT EXISTS `frends` (
  `user` int(11) NOT NULL default '0',
  `frend` int(11) NOT NULL default '0',
  `time` int(11) NOT NULL,
  `i` int(1) default '0',
  PRIMARY KEY  (`user`,`frend`),
  KEY `time` (`time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


CREATE TABLE IF NOT EXISTS `frends_new` (
  `id` int(11) NOT NULL auto_increment,
  `user` int(11) NOT NULL default '0',
  `to` int(11) NOT NULL default '0',
  `time` int(11) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `time` (`time`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;

CREATE TABLE `wall` (
  `id` int(6) NOT NULL auto_increment,
  `user_id` int(6) NOT NULL,
  `who` int(6) NOT NULL,
  `time` int(11) NOT NULL,
  `message` text NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=cp1251 AUTO_INCREMENT=8 ;


ALTER TABLE `users` ADD `msg_on_wall` TEXT NOT NULL ;