1 | <?php |
---|
2 | // +-----------------------------------------------------------------------+ |
---|
3 | // | PhpWebGallery - a PHP based picture gallery | |
---|
4 | // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | |
---|
5 | // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | |
---|
6 | // +-----------------------------------------------------------------------+ |
---|
7 | // | file : $Id: 59-database.php 1926 2007-03-28 19:57:00Z rub $ |
---|
8 | // | last update : $Date: 2007-03-28 19:57:00 +0000 (Wed, 28 Mar 2007) $ |
---|
9 | // | last modifier : $Author: rub $ |
---|
10 | // | revision : $Revision: 1926 $ |
---|
11 | // +-----------------------------------------------------------------------+ |
---|
12 | // | This program is free software; you can redistribute it and/or modify | |
---|
13 | // | it under the terms of the GNU General Public License as published by | |
---|
14 | // | the Free Software Foundation | |
---|
15 | // | | |
---|
16 | // | This program is distributed in the hope that it will be useful, but | |
---|
17 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
18 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
19 | // | General Public License for more details. | |
---|
20 | // | | |
---|
21 | // | You should have received a copy of the GNU General Public License | |
---|
22 | // | along with this program; if not, write to the Free Software | |
---|
23 | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
24 | // | USA. | |
---|
25 | // +-----------------------------------------------------------------------+ |
---|
26 | |
---|
27 | if (!defined('PHPWG_ROOT_PATH')) |
---|
28 | { |
---|
29 | die('Hacking attempt!'); |
---|
30 | } |
---|
31 | |
---|
32 | $upgrade_description = 'Rename some indexes following PWG naming rules'; |
---|
33 | |
---|
34 | include_once(PHPWG_ROOT_PATH.'include/constants.php'); |
---|
35 | |
---|
36 | // +-----------------------------------------------------------------------+ |
---|
37 | // | Upgrade content | |
---|
38 | // +-----------------------------------------------------------------------+ |
---|
39 | |
---|
40 | $query = " |
---|
41 | DROP INDEX image_category ON ".IMAGE_CATEGORY_TABLE." |
---|
42 | ; |
---|
43 | "; |
---|
44 | pwg_query($query); |
---|
45 | |
---|
46 | $query = " |
---|
47 | CREATE INDEX image_category_i1 ON ".IMAGE_CATEGORY_TABLE." (category_id) |
---|
48 | ; |
---|
49 | "; |
---|
50 | pwg_query($query); |
---|
51 | |
---|
52 | $query = " |
---|
53 | DROP INDEX uidx_check_key ON ".USER_MAIL_NOTIFICATION_TABLE." |
---|
54 | ; |
---|
55 | "; |
---|
56 | pwg_query($query); |
---|
57 | |
---|
58 | $query = " |
---|
59 | CREATE UNIQUE INDEX user_mail_notification_ui1 ON ".USER_MAIL_NOTIFICATION_TABLE." (check_key) |
---|
60 | ; |
---|
61 | "; |
---|
62 | pwg_query($query); |
---|
63 | |
---|
64 | $query = " |
---|
65 | DROP INDEX name ON ".WEB_SERVICES_ACCESS_TABLE." |
---|
66 | ; |
---|
67 | "; |
---|
68 | pwg_query($query); |
---|
69 | |
---|
70 | $query = " |
---|
71 | CREATE UNIQUE INDEX ws_access_ui1 ON ".WEB_SERVICES_ACCESS_TABLE." (name) |
---|
72 | ; |
---|
73 | "; |
---|
74 | pwg_query($query); |
---|
75 | |
---|
76 | echo |
---|
77 | "\n" |
---|
78 | .'"'.$upgrade_description.'"'.' ended' |
---|
79 | ."\n" |
---|
80 | ; |
---|
81 | |
---|
82 | ?> |
---|