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
15 * @version $Id: upgrade3.2.php 1388 2009-07-18 06:31:28Z shizuki $
18 function upgrade_do320() {
20 if (upgrade_checkinstall(320))
21 return 'already installed';
23 // create nucleus_activation table
24 if (!upgrade_checkIfTableExists('tickets')) {
25 $query = 'CREATE TABLE ' . sql_table('activation') . ' ('
26 . ' vkey varchar(40) NOT NULL default \'\','
27 . ' vtime datetime NOT NULL default \'0000-00-00 00:00:00\','
28 . ' vmember int(11) NOT NULL default \'0\','
29 . ' vtype varchar(15) NOT NULL default \'\','
30 . ' vextra varchar(128) NOT NULL default \'\','
31 . ' PRIMARY KEY (vkey) '
33 upgrade_query('Creating account activation table', $query);
36 // create CookiePrefix setting
37 if (!upgrade_checkIfCVExists('CookiePrefix')) {
38 $query = 'INSERT INTO '.sql_table('config')." VALUES ('CookiePrefix','')";
39 upgrade_query('Creating CookiePrefix config value',$query);
42 // create nucleus_tickets table
43 if (!upgrade_checkIfTableExists('tickets')) {
44 $query = 'CREATE TABLE ' . sql_table('tickets') . ' ('
45 . ' ticket varchar(40) NOT NULL default \'\','
46 . ' ctime datetime NOT NULL default \'0000-00-00 00:00:00\','
47 . ' member int(11) NOT NULL default \'0\', '
48 . ' PRIMARY KEY (ticket, member) '
50 upgrade_query('Creating ticket table', $query);
54 // update database version
55 update_version('320');