3 * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
4 * Copyright (C) 2002-2012 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 function upgrade_do330() {
15 if (upgrade_checkinstall(330))
18 if (!upgrade_checkIfColumnExists('comment','cemail')) {
19 $query = " ALTER TABLE `" . sql_table('comment') . "`
20 ADD `cemail` VARCHAR( 100 ) AFTER `cmail` ;";
22 upgrade_query('Altering ' . sql_table('comment') . ' table', $query);
25 if (!upgrade_checkIfColumnExists('blog','breqemail')) {
26 $query = " ALTER TABLE `" . sql_table('blog') . "`
27 ADD `breqemail` TINYINT( 2 ) DEFAULT '0' NOT NULL ;";
29 upgrade_query('Altering ' . sql_table('blog') . ' table', $query);
32 // check cmail column to separate to URL and cemail
34 'UPDATE ' . sql_table('comment') . ' ' .
35 "SET cemail = cmail, cmail = '' " .
36 "WHERE cmail LIKE '%@%'"
54 // update database version
55 update_version('330');