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

Last change on this file since 1904 was 1903, checked in by vdigital, 17 years ago

Updates:

  • Copyrights 2003-2007
  • help
  • Some HTML comform requests
  • Property svn:eol-style set to LF
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-2007 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.