Location: PHPKode > projects > Esvon Personals > esvon-personals/upgrades/v4_to_v4_09/upgrade403-404.php
<?php

// File to upgrade Esvon Classifieds from 4.0.3 to 4.0.4
// After use this, you can delete it

//*********************************************

define('DB_UPGRADE', 1);

if(!defined('SITE_PATH')){
  if(!file_exists('./inc/application.php')) die("File Not Found: application.php");
  require_once './inc/application.php';
}

if(hwModGetState('Auto_Notify')){
  mysql_query("ALTER TABLE ".hwModTable('Auto_Notify','data')." ADD search_extra text NOT NULL");
}

if(hwModGetState('Coupons')){
  mysql_query("ALTER TABLE ".hwModTable('Coupons','data')." ADD price_plans text NOT NULL");
}

if(!defined('TBL_DEP_MENU')) die('Not defined: TBL_DEP_MENU');

mysql_query("CREATE TABLE ".TBL_DEP_MENU." (
   id smallint(5) unsigned NOT NULL auto_increment,
   pid tinyint(3) unsigned NOT NULL,
   name varchar(100) NOT NULL,
   PRIMARY KEY (id),
   UNIQUE (name)
)");

if(!defined('TBL_DEP_MENU_TREE')) define('TBL_DEP_MENU_TREE',TBL_PREFIX.'dep_menu_tree');

mysql_query("CREATE TABLE ".TBL_DEP_MENU_TREE." (
   id mediumint(8) unsigned NOT NULL auto_increment,
   menu_id smallint(5) unsigned NOT NULL,
   pid mediumint(8) unsigned NOT NULL,
   name varchar(100) NOT NULL,
   weight smallint(5) unsigned NOT NULL,
   PRIMARY KEY (id),
   KEY pid (pid),
   KEY (menu_id)
)");

if(hwModGetState('Multi_Lang')){

  mysql_query("CREATE TABLE ".hwModTable('Multi_Lang','depmenu')." (
  id mediumint(8) unsigned NOT NULL,
  lang_id varchar(10) NOT NULL,
  name varchar(100) NOT NULL,
  PRIMARY KEY (id,lang_id))"); 
}

if(hwModGetState('Regions')){
  mysql_query("ALTER TABLE ".hwModTable('Regions','category')." ADD meta_t varchar(255) NOT NULL");
  mysql_query("ALTER TABLE ".hwModTable('Regions','category')." ADD meta_k text NOT NULL");
  mysql_query("ALTER TABLE ".hwModTable('Regions','category')." ADD meta_d text NOT NULL");
}

if(hwModGetState('Mailing_Lists')){
  mysql_query("ALTER TABLE ".hwModTable('Mailing_Lists','idx')." ADD hide tinyint(3) unsigned NOT NULL");
  mysql_query("ALTER TABLE ".hwModTable('Mailing_Lists','idx')." ADD capture tinyint(3) unsigned NOT NULL");
}

echo 'Esvon Classifieds Tables Updated, Ok.. ('.basename(__FILE__).')';

?>
Return current item: Esvon Personals