source: extensions/linked_pages/maintain.class.php @ 29530

Last change on this file since 29530 was 28845, checked in by mistic100, 10 years ago

use new maintain class

File size: 852 bytes
Line 
1<?php
2defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
3
4class linked_pages_maintain extends PluginMaintain
5{
6  private $table;
7 
8  function __construct($plugin_id)
9  {
10    global $prefixeTable;
11   
12    parent::__construct($plugin_id);
13    $this->table = $prefixeTable . 'linked_pages';
14  }
15 
16  function install($plugin_version, &$errors=array())
17  {
18    pwg_query('
19CREATE TABLE IF NOT EXISTS `' . $this->table . '` (
20  `page_id` smallint(5) unsigned NOT NULL,
21  `category_id` smallint(5) unsigned NOT NULL,
22  `pos` smallint(5) unsigned NOT NULL,
23  UNIQUE KEY `UNIQUE`(`page_id`,`category_id`)
24) ENGINE=MyISAM DEFAULT CHARSET=utf8
25;');
26  }
27
28  function update($old_version, $new_version, &$errors=array())
29  {
30    $this->install($new_version, $errors);
31  }
32
33  function uninstall()
34  {
35    pwg_query('DROP TABLE `' . $this->table . '`;');
36  }
37}
Note: See TracBrowser for help on using the repository browser.