3 * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
4 * Copyright (C) 2002-2009 The Nucleus Group
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 * (see nucleus/documentation/index.html#license for more info)
13 * @license http://nucleuscms.org/license.txt GNU General Public License
14 * @copyright Copyright (C) 2002-2009 The Nucleus Group
16 * $NucleusJP: upgrade3.2.php,v 1.5.2.1 2007/10/24 05:39:16 kimitake Exp $
20 function upgrade_do320() {
22 if (upgrade_checkinstall(320))
23 return 'already installed';
25 // create nucleus_activation table
26 if (!upgrade_checkIfTableExists('tickets')) {
27 $query = 'CREATE TABLE ' . sql_table('activation') . ' ('
28 . ' vkey varchar(40) NOT NULL default \'\','
29 . ' vtime datetime NOT NULL default \'0000-00-00 00:00:00\','
30 . ' vmember int(11) NOT NULL default \'0\','
31 . ' vtype varchar(15) NOT NULL default \'\','
32 . ' vextra varchar(128) NOT NULL default \'\','
33 . ' PRIMARY KEY (vkey) '
35 upgrade_query('Creating account activation table', $query);
38 // create CookiePrefix setting
39 if (!upgrade_checkIfCVExists('CookiePrefix')) {
40 $query = 'INSERT INTO '.sql_table('config')." VALUES ('CookiePrefix','')";
41 upgrade_query('Creating CookiePrefix config value',$query);
44 // create nucleus_tickets table
45 if (!upgrade_checkIfTableExists('tickets')) {
46 $query = 'CREATE TABLE ' . sql_table('tickets') . ' ('
47 . ' ticket varchar(40) NOT NULL default \'\','
48 . ' ctime datetime NOT NULL default \'0000-00-00 00:00:00\','
49 . ' member int(11) NOT NULL default \'0\', '
50 . ' PRIMARY KEY (ticket, member) '
52 upgrade_query('Creating ticket table', $query);
56 // update database version
57 update_version('320');