OSDN Git Service

ADDED: upgrade code for 3.5 in upgrades folder. Includes notices about end of PHP4...
[nucleus-jp/nucleus-jp-ancient.git] / utf8 / nucleus / upgrades / upgrade3.3.php
1 <?php
2 /*
3  * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
4  * Copyright (C) 2002-2009 The Nucleus Group
5  *
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)
11  */
12 /**
13  * @license http://nucleuscms.org/license.txt GNU General Public License
14  * @copyright Copyright (C) 2002-2009 The Nucleus Group
15  * @version $Id$
16  * $NucleusJP: upgrade3.3.php,v 1.5.2.1 2007/10/24 05:39:16 kimitake Exp $
17  *
18  */
19
20 function upgrade_do330() {
21
22     if (upgrade_checkinstall(330))
23         return 'already installed';
24
25     if (!upgrade_checkIfColumnExists('comment','cemail')) {
26         $query = "  ALTER TABLE `" . sql_table('comment') . "`
27                     ADD `cemail` VARCHAR( 100 ) AFTER `cmail` ;";
28
29         upgrade_query('Altering ' . sql_table('comment') . ' table', $query);
30     }
31
32     if (!upgrade_checkIfColumnExists('blog','breqemail')) {
33         $query = "  ALTER TABLE `" . sql_table('blog') . "`
34                     ADD `breqemail` TINYINT( 2 ) DEFAULT '0' NOT NULL ;";
35
36         upgrade_query('Altering ' . sql_table('blog') . ' table', $query);
37     }
38
39     // check cmail column to separate to URL and cemail
40     mysql_query(
41         'UPDATE ' . sql_table('comment') . ' ' . 
42         "SET cemail = cmail, cmail = '' " .
43         "WHERE cmail LIKE '%@%'"
44     );
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60     // 3.2 -> 3.3
61     // update database version
62     update_version('330');
63
64
65
66
67
68
69
70 }
71
72 ?>