Ignore:
Timestamp:
Nov 4, 2010, 1:42:14 AM (10 years ago)
Author:
grum
Message:

fix bug:2004 - Cache table becomes very huge
fix bug:2005 - Category map is not displayed when a [gmaps] map is inserted in category description

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/GMaps/gmaps_install.class.inc.php

    r7548 r7616  
    8787)",
    8888"CREATE TABLE `".$this->tables['cache']."` (
     89  `requestId` mediumint(8) UNSIGNED NOT NULL default '0',
     90  `imageId` mediumint(8) NOT NULL,
     91  `latitude` decimal(17,14) NOT NULL default '0',
     92  `longitude` decimal(17,14) NOT NULL default '0',
     93  PRIMARY KEY (`requestId`,`imageId`)
     94)",
     95"CREATE TABLE `".$this->tables['cache_id']."` (
     96  `requestId` mediumint(8) UNSIGNED NOT NULL auto_increment,
    8997  `userId` smallint(5) NOT NULL,
    90   `requestId` timestamp NOT NULL default '0000-00-00 00:00:00',
    91   `imageId` mediumint(8) NOT NULL,
    92   `latitude` decimal(20,17) NOT NULL default '0.00000000000000000',
    93   `longitude` decimal(20,17) NOT NULL default '0.00000000000000000',
    94   `imageName` varchar(255) NOT NULL,
    95   `imageTnFile` varchar(255) NOT NULL,
    96   `imageCatsId` varchar(255) NOT NULL,
    97   `imageCatsNames` varchar(255) NOT NULL,
    98   `imageCatsPLink` varchar(255) NOT NULL,
    99   PRIMARY KEY  USING BTREE (`userId`,`requestId`,`imageId`)
     98  `date` timestamp NOT NULL default '0000-00-00 00:00:00',
     99  PRIMARY KEY (`requestId`)
    100100)",
    101101"CREATE TABLE `".$this->tables['kmlfiles']."` (
     
    144144        case '01.01.00':
    145145          $this->updateFrom_010100();
     146        case '01.02.00':
     147        case '01.02.01':
     148        case '01.02.02':
     149          $this->updateFrom_010202();
    146150        default:
    147151          // nothing to do...
     
    218222    }
    219223
     224    /**
     225     * update from release 1.2.2
     226     *
     227     */
     228    private function updateFrom_010202()
     229    {
     230      $sql="DROP TABLE ".$this->tables['cache'];
     231      pwg_query($sql);
     232
     233      $tablesCreate=array(
     234"CREATE TABLE `".$this->tables['cache']."` (
     235  `requestId` int(8) UNSIGNED NOT NULL default '0',
     236  `imageId` mediumint(8) NOT NULL,
     237  `latitude` decimal(17,14) NOT NULL default '0',
     238  `longitude` decimal(17,14) NOT NULL default '0',
     239  PRIMARY KEY (`requestId`,`imageId`)
     240);",
     241"CREATE TABLE `".$this->tables['cache_id']."` (
     242  `requestId` mediumint(8) UNSIGNED NOT NULL auto_increment,
     243  `userId` smallint(5) NOT NULL,
     244  `date` NOT NULL default '0000-00-00 00:00:00',
     245  PRIMARY KEY (`requestId`)
     246)"
     247      );
     248
     249      $tablesUpdate=array(
     250        $this->tables['category_maps'] => array(
     251          'forceDisplay' => " ADD COLUMN `forceDisplay` CHAR(1)  NOT NULL DEFAULT 'n' AFTER `title` ",
     252        )
     253      );
     254
     255      $tablesDef = create_table_add_character_set($tablesCreate);
     256
     257      $tablef=new GPCTables(array($this->tables['cache'], $this->tables['cache_id']));
     258      $tablef->create($tablesCreate);
     259      $tablef->updateTablesFields($tablesUpdate);
     260
     261      unset($tablesCreate);
     262      unset($tablesUpdate);
     263    }
    220264
    221265
Note: See TracChangeset for help on using the changeset viewer.