diff options
Diffstat (limited to '')
-rw-r--r-- | install/db/22-database.php | 58 | ||||
-rw-r--r-- | install/phpwebgallery_structure.sql | 6 |
2 files changed, 62 insertions, 2 deletions
diff --git a/install/db/22-database.php b/install/db/22-database.php new file mode 100644 index 000000000..fcead3cf2 --- /dev/null +++ b/install/db/22-database.php @@ -0,0 +1,58 @@ +<?php +// +-----------------------------------------------------------------------+ +// | PhpWebGallery - a PHP based picture gallery | +// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | +// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net | +// +-----------------------------------------------------------------------+ +// | branch : BSF (Best So Far) +// | file : $RCSfile$ +// | last update : $Date: 2005-09-21 00:04:57 +0200 (mer, 21 sep 2005) $ +// | last modifier : $Author: plg $ +// | revision : $Revision: 870 $ +// +-----------------------------------------------------------------------+ +// | This program is free software; you can redistribute it and/or modify | +// | it under the terms of the GNU General Public License as published by | +// | the Free Software Foundation | +// | | +// | This program is distributed in the hope that it will be useful, but | +// | WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | General Public License for more details. | +// | | +// | You should have received a copy of the GNU General Public License | +// | along with this program; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | +// | USA. | +// +-----------------------------------------------------------------------+ + +if (!defined('PHPWG_ROOT_PATH')) +{ + die('Hacking attempt!'); +} + +$upgrade_description = 'add index on #tags.url_name and #image_tag.tag_id '; + + + +$query = ' +ALTER TABLE '.PREFIX_TABLE.'tags ADD INDEX `tags_i1`(`url_name`); +;'; +pwg_query($query); + + +$query = ' +ALTER TABLE '.PREFIX_TABLE.'image_tag ADD INDEX `image_tag_i1`(`tag_id`); +;'; +pwg_query($query); + + +// +-----------------------------------------------------------------------+ +// | End notification | +// +-----------------------------------------------------------------------+ + +echo +"\n" +.'Tables '.PREFIX_TABLE.'tags and '.PREFIX_TABLE.'image_tag updated'."\n" +; +echo $upgrade_description; +?> diff --git a/install/phpwebgallery_structure.sql b/install/phpwebgallery_structure.sql index 253157e79..dbc7b2335 100644 --- a/install/phpwebgallery_structure.sql +++ b/install/phpwebgallery_structure.sql @@ -140,7 +140,8 @@ DROP TABLE IF EXISTS `phpwebgallery_image_tag`; CREATE TABLE `phpwebgallery_image_tag` ( `image_id` mediumint(8) unsigned NOT NULL default '0', `tag_id` smallint(5) unsigned NOT NULL default '0', - PRIMARY KEY (`image_id`,`tag_id`) + PRIMARY KEY (`image_id`,`tag_id`), + KEY `image_tag_i1` (`tag_id`) ) TYPE=MyISAM; -- @@ -233,7 +234,8 @@ CREATE TABLE `phpwebgallery_tags` ( `id` smallint(5) unsigned NOT NULL auto_increment, `name` varchar(255) binary NOT NULL default '', `url_name` varchar(255) binary NOT NULL default '', - PRIMARY KEY (`id`) + PRIMARY KEY (`id`), + KEY `tags_i1` (`url_name`) ) TYPE=MyISAM; -- |