CREATE TABLE IF NOT EXISTS {prefix}admin_menus (
idmenu int(11) NOT NULL,
  title varchar(150) NOT NULL,
  idunique varchar(25) NOT NULL,
  target varchar(150) NOT NULL,
  icon varchar(100) NOT NULL,
  idparent varchar(15) NOT NULL DEFAULT ''
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS {prefix}languages (
id int(10) unsigned NOT NULL,
  `name` char(49) DEFAULT NULL,
  `code` char(5) DEFAULT NULL
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS {prefix}settings (
  var varchar(50) NOT NULL,
  `value` text NOT NULL,
  label varchar(150) NOT NULL,
  helper text NOT NULL,
  `type` enum('text','numeric','select','textarea','select-multiple','password') NOT NULL,
  `options` varchar(200) NOT NULL,
  attr varchar(250) NOT NULL,
  class varchar(150) NOT NULL,
  module varchar(50) NOT NULL,
  `order` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS {prefix}translation (
id int(11) NOT NULL,
  `code` varchar(250) NOT NULL,
  translation varchar(250) NOT NULL,
  code_lang varchar(4) NOT NULL
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS {prefix}users (
id int(11) NOT NULL,
  username varchar(250) NOT NULL,
  email varchar(150) NOT NULL,
  `names` varchar(250) NOT NULL,
  avatar varchar(250) NOT NULL,
  is_admin int(11) NOT NULL DEFAULT '0',
  registered timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `password` varchar(250) NOT NULL,
  lang char(2) NOT NULL DEFAULT 'en',
  facebook_url varchar(250) NOT NULL,
  twitter_url varchar(250) NOT NULL,
  google_plus_url varchar(250) NOT NULL,
  spotify_url varchar(250) NOT NULL,
  website_url varchar(250) NOT NULL,
  idfacebook varchar(100) NOT NULL,
  idgoogle varchar(100) NOT NULL,
  idvk varchar(100) NOT NULL,
  idspotify varchar(50) NOT NULL,
  recovery varchar(250) NOT NULL,
  validation varchar(250) NOT NULL
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
ALTER TABLE {prefix}admin_menus ADD PRIMARY KEY (idmenu), ADD UNIQUE KEY idunique (idunique);
ALTER TABLE {prefix}languages ADD PRIMARY KEY (id);
ALTER TABLE {prefix}settings ADD PRIMARY KEY (var), ADD UNIQUE KEY var (var), ADD KEY var_2 (var);
ALTER TABLE {prefix}translation ADD PRIMARY KEY (id), ADD UNIQUE KEY `code` (`code`,code_lang);
ALTER TABLE {prefix}users ADD PRIMARY KEY (id), ADD UNIQUE KEY username (username), ADD KEY username_2 (username), ADD KEY `password` (`password`);
ALTER TABLE {prefix}users_history ADD PRIMARY KEY (idhistory), ADD UNIQUE KEY id (id,created);
ALTER TABLE {prefix}admin_menus MODIFY idmenu int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
ALTER TABLE {prefix}languages MODIFY id int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
ALTER TABLE {prefix}translation MODIFY id int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
ALTER TABLE {prefix}users MODIFY id int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
ALTER TABLE {prefix}languages ADD UNIQUE KEY `code` (code);