Ignore:
Timestamp:
Feb 11, 2014, 1:25:40 PM (7 years ago)
Author:
JanisV
Message:

Updated storing association physical 2 virtual

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/physical2virtual/maintain.inc.php

    r27229 r27330  
    2727  function __construct($plugin_id)
    2828  {
     29    global $prefixeTable;
     30
    2931    parent::__construct($plugin_id);
     32
     33    $this->table = $prefixeTable . 'phy2virt_categories';
    3034  }
    3135
    3236  function install($plugin_version, &$errors=array())
    3337  {
    34     global $conf;
     38    global $conf, $prefixeTable;
    3539
    3640    if (empty($conf['physical2virtual']))
     
    4751    }
    4852   
     53    // new table
     54    pwg_query(
     55'CREATE TABLE IF NOT EXISTS `' . $this->table . '` (
     56  `phy_category_id` smallint(5) unsigned NOT NULL,
     57  `virt_category_id` smallint(5) unsigned NOT NULL,
     58  `updated` DATETIME NOT NULL DEFAULT "1970-01-01 00:00:00",
     59  KEY `phy_category_id` (`phy_category_id`)
     60) ENGINE=MyISAM DEFAULT CHARSET=utf8
     61;');
     62
    4963    $this->installed = true;
    5064  }
     
    6579  {
    6680    conf_delete_param('physical2virtual');
     81
     82    pwg_query('DROP TABLE `' . $this->table . '`;');
    6783  }
    6884}
Note: See TracChangeset for help on using the changeset viewer.