OSDN Git Service

NP_Ping and related infrastructure changes. (admun)
[nucleus-jp/nucleus-jp-ancient.git] / utf8 / nucleus / upgrades / upgrade3.2.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.2.php,v 1.5.2.1 2007/10/24 05:39:16 kimitake Exp $
17  *
18  */
19
20 function upgrade_do320() {
21
22     if (upgrade_checkinstall(320))
23         return 'already installed';
24
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) '
34                . ' )';
35         upgrade_query('Creating account activation table', $query);    
36     }
37     
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); 
42     }
43
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) '
51                . ' )';
52         upgrade_query('Creating ticket table', $query);    
53     }
54     
55     // 3.1 -> 3.2
56     // update database version  
57     update_version('320');
58     
59     // nothing!
60 }
61
62 ?>