source: trunk/install/db/7-database.php @ 1641

Last change on this file since 1641 was 1041, checked in by rvelices, 19 years ago

feature 251: Rating For Anonymous users

fix: pageitems for favorites category and remove old use of $has_next,
$has_prev in picture.php (slideshow and favorites section)

optimization: one less sql query in picture.php when there are no comments

display of the refresh url in redirect.tpl (useful when debugging with
browser meta redirects disabled)

File size: 2.7 KB
Line 
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-2006 PhpWebGallery Team - http://phpwebgallery.net |
6// | Copyright (C) 2006 Ruben ARNAUD - team@phpwebgallery.net              |
7// +-----------------------------------------------------------------------+
8// | branch        : BSF (Best So Far)
9// | file          : $RCSfile$
10// | last update   : $Date: 2005-09-21 00:04:57 +0200 (mer, 21 sep 2005) $
11// | last modifier : $Author: plg $
12// | revision      : $Revision: 870 $
13// +-----------------------------------------------------------------------+
14// | This program is free software; you can redistribute it and/or modify  |
15// | it under the terms of the GNU General Public License as published by  |
16// | the Free Software Foundation                                          |
17// |                                                                       |
18// | This program is distributed in the hope that it will be useful, but   |
19// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
20// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
21// | General Public License for more details.                              |
22// |                                                                       |
23// | You should have received a copy of the GNU General Public License     |
24// | along with this program; if not, write to the Free Software           |
25// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
26// | USA.                                                                  |
27// +-----------------------------------------------------------------------+
28
29if (!defined('PHPWG_ROOT_PATH'))
30{
31  die('Hacking attempt!');
32}
33
34$upgrade_description = 'Anonymous rating';
35
36// +-----------------------------------------------------------------------+
37// |                            Upgrade content                            |
38// +-----------------------------------------------------------------------+
39
40$query = '
41ALTER TABLE '.PREFIX_TABLE.'rate DROP PRIMARY KEY;'
42;
43pwg_query($query);
44
45$query ='
46ALTER TABLE '.PREFIX_TABLE.'rate ADD COLUMN anonymous_id VARCHAR(45) NOT NULL DEFAULT \'\' AFTER element_id;'
47;
48pwg_query($query);
49
50$query ='
51ALTER TABLE '.PREFIX_TABLE.'rate ADD COLUMN date DATE NOT NULL AFTER rate;'
52;
53pwg_query($query);
54
55$query ='
56UPDATE '.PREFIX_TABLE.'rate SET date=NOW() WHERE date<"1990-01-01";'
57;
58pwg_query($query);
59
60$query = '
61ALTER TABLE '.PREFIX_TABLE.'rate ADD PRIMARY KEY (element_id, user_id, anonymous_id);'
62;
63pwg_query($query);
64
65echo
66"\n"
67.'Table '.PREFIX_TABLE.'rate upgraded'
68."\n"
69;
70?>
Note: See TracBrowser for help on using the repository browser.