<?php

if (!defined('UPGRADE_RUN')) { exit; }

/* UPGRADE - TABLES
------------------------------------------------------*/

foreach (array('admin_pages', 'cfg') AS $upTable) {
  if (mswCheckTable($upTable, $DB) == 'no') {
    $q = $DB->db_query(strtr(mswTmp(PATH . 'control/sql/tables/' . $upTable . '.sql'), array('{prefix}' => DB_PREFIX, '{engine}' => $tableType)), true);
    if ($q === 'err') {
      $ERR = $DB->db_error(true);
      mswUpLog(DB_PREFIX . $upTable, $ERR[1], $ERR[0], __line__, __file__, 'Add Table');
    } else {
      mswUpLog('New table added: `' . DB_PREFIX . '`', 'instruction');
    }
  }
}

?>
