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.3.php,v 1.5.2.1 2007/10/24 05:39:16 kimitake Exp $
20 function upgrade_do330() {
22 if (upgrade_checkinstall(330))
23 return 'already installed';
25 if (!upgrade_checkIfColumnExists('comment','cemail')) {
26 $query = " ALTER TABLE `" . sql_table('comment') . "`
27 ADD `cemail` VARCHAR( 100 ) AFTER `cmail` ;";
29 upgrade_query('Altering ' . sql_table('comment') . ' table', $query);
32 if (!upgrade_checkIfColumnExists('blog','breqemail')) {
33 $query = " ALTER TABLE `" . sql_table('blog') . "`
34 ADD `breqemail` TINYINT( 2 ) DEFAULT '0' NOT NULL ;";
36 upgrade_query('Altering ' . sql_table('blog') . ' table', $query);
39 // check cmail column to separate to URL and cemail
41 'UPDATE ' . sql_table('comment') . ' ' .
42 "SET cemail = cmail, cmail = '' " .
43 "WHERE cmail LIKE '%@%'"
61 // update database version
62 update_version('330');