CREATE TABLE IF NOT EXISTS `maf_act` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_from` int(11) DEFAULT NULL,
  `id_to` int(11) NOT NULL,
  `type` varchar(12) NOT NULL DEFAULT 'act',
  `time` int(11) NOT NULL,
  `role` int(2) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;


INSERT INTO `maf_act` (`id_from`, `id_to`, `type`, `time`, `role`) VALUES
(0, 0, 'free', 0, 0);


CREATE TABLE IF NOT EXISTS `maf_chat` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_user` int(11) DEFAULT NULL,
  `time` int(11) NOT NULL,
  `msg` varchar(1024) DEFAULT NULL,
  `maf` set('0','1') DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

ALTER TABLE `user` ADD `m_role` int(2) DEFAULT NULL;
 ALTER TABLE `user` ADD  `m_live` set('-1','0','1') DEFAULT 0;
  ALTER TABLE `user` ADD `m_reg` set('0','1') DEFAULT 0;
  ALTER TABLE `user` ADD `m_vote` int(11) DEFAULT NULL;
  ALTER TABLE `user` ADD `m_cheked_maf` set('0','1') DEFAULT 0;
  ALTER TABLE `user` ADD `m_cheked_mir` set('0','1') DEFAULT 0;
  ALTER TABLE `user` ADD `m_options` set('0','1') DEFAULT '0';
  ALTER TABLE `user` ADD `m_reg_forget` set('0','1') DEFAULT '0';
    ALTER TABLE `user` ADD `m_win` int(11) DEFAULT NULL;
    ALTER TABLE `user` ADD `m_win_week` int(11) DEFAULT NULL;
INSERT INTO `user_group` (`id`, `name`, `level`) VALUES
(11, 'Модератор мафии', 1);
INSERT INTO `all_accesses` (`type`,`name`) VALUES ('mafia_restart','Админка мафии');