ALTER TABLE `site_settings` ADD `install` INT(11) NOT NULL AFTER `global_premium`;
ALTER TABLE `site_settings` ADD `login_protect` INT(11) NOT NULL;
ALTER TABLE `site_settings` ADD `activate_account` INT(11) NOT NULL;
ALTER TABLE `users` ADD `active` INT(11) NOT NULL DEFAULT '1', ADD `activate_code` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;

INSERT INTO `email_templates` (`ID`, `title`, `message`) VALUES (NULL, 'Email Activation', 'Dear [NAME], <br /><br /> Someone (hopefully you) has registered an account on [SITE_NAME] using this email address. <br /><br /> Please activate the account by following this link: [EMAIL_LINK] <br /><br /> If you did not register an account, please kindly ignore this email. <br /><br /> Yours, <br /> [SITE_NAME]');

CREATE TABLE `login_attempts` (
  `ID` int(11) NOT NULL,
  `IP` varchar(500) NOT NULL,
  `username` varchar(500) NOT NULL,
  `count` int(11) NOT NULL,
  `timestamp` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

ALTER TABLE `login_attempts`
  ADD PRIMARY KEY (`ID`);

ALTER TABLE `login_attempts`
  MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;

CREATE TABLE `user_events` (
  `ID` int(11) NOT NULL,
  `IP` varchar(255) NOT NULL,
  `event` varchar(255) NOT NULL,
  `timestamp` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

ALTER TABLE `user_events`
  ADD PRIMARY KEY (`ID`);


ALTER TABLE `user_events`
  MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;