OSDN Git Service

Subversion由来のタグを削除
[nucleus-jp/nucleus-jp-ancient.git] / nucleus / upgrades / upgrade3.2.php
1 <?php
2 /*
3  * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
4  * Copyright (C) 2002-2012 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 function upgrade_do320() {
14
15     if (upgrade_checkinstall(320))
16         return 'インストール済みです';
17
18     // create nucleus_activation table
19     if (!upgrade_checkIfTableExists('tickets')) {
20         $query = 'CREATE TABLE ' . sql_table('activation') . ' ('
21                . ' vkey varchar(40) NOT NULL default \'\','
22                . ' vtime datetime NOT NULL default \'0000-00-00 00:00:00\','
23                . ' vmember int(11) NOT NULL default \'0\','
24                . ' vtype varchar(15) NOT NULL default \'\','
25                . ' vextra varchar(128) NOT NULL default \'\','
26                . ' PRIMARY KEY  (vkey) '
27                . ' )';
28         upgrade_query('Creating account activation table', $query);    
29     }
30     
31     // create CookiePrefix setting
32     if (!upgrade_checkIfCVExists('CookiePrefix')) {
33         $query = 'INSERT INTO '.sql_table('config')." VALUES ('CookiePrefix','')";
34         upgrade_query('Creating CookiePrefix config value',$query); 
35     }
36
37     // create nucleus_tickets table
38     if (!upgrade_checkIfTableExists('tickets')) {
39         $query = 'CREATE TABLE ' . sql_table('tickets') . ' ('
40                . ' ticket varchar(40) NOT NULL default \'\','
41                . ' ctime datetime NOT NULL default \'0000-00-00 00:00:00\','
42                . ' member int(11) NOT NULL default \'0\', '
43                . ' PRIMARY KEY  (ticket, member) '
44                . ' )';
45         upgrade_query('Creating ticket table', $query);    
46     }
47     
48     // 3.1 -> 3.2
49     // update database version  
50     update_version('320');
51     
52     // nothing!
53 }
54
55 ?>