• R/O
  • HTTP
  • SSH
  • HTTPS

nucleus-plugins: Commit

Nucleus CMS日本語版用プラグインのうち、日本語版開発者がサポートしているもの


Commit MetaInfo

Revision9eb992e63c61f6386f8f703da3371e13515d5250 (tree)
Time2008-02-06 08:05:15
Authorkmorimatsu <kmorimatsu@1ca2...>
Commiterkmorimatsu

Log Message

Now, all apgrade scripts are automatically performed by the wrapper.

git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/plugin@605 1ca29b6e-896d-4ea0-84a5-967f57386b96

Change Summary

  • delete: trunk/sqlite/nucleus/upgrades/upgrade3.3.php

Incremental Difference

--- a/trunk/sqlite/nucleus/upgrades/upgrade3.3.php
+++ /dev/null
@@ -1,114 +0,0 @@
1-<?php
2-function upgrade_do33() {
3-
4- if (upgrade_checkinstall(33))
5- return 'already installed';
6-
7- // alter nucleus_blog table
8- $data=upgrade_sqlite_data('blog');
9- $query = 'DROP TABLE ' . sql_table('blog');
10- upgrade_query('Dropping ' . sql_table('blog') . ' table', $query);
11- $query="CREATE TABLE `".sql_table('blog')."` (
12- `bnumber` int(11) NOT NULL auto_increment,
13- `bname` varchar(60) NOT NULL default '',
14- `bshortname` varchar(15) NOT NULL default '',
15- `bdesc` varchar(200) default NULL,
16- `bcomments` tinyint(2) NOT NULL default '1',
17- `bmaxcomments` int(11) NOT NULL default '0',
18- `btimeoffset` decimal(3,1) NOT NULL default '0.0',
19- `bnotify` varchar(60) default NULL,
20- `burl` varchar(100) default NULL,
21- `bupdate` varchar(60) default NULL,
22- `bdefskin` int(11) NOT NULL default '1',
23- `bpublic` tinyint(2) NOT NULL default '1',
24- `bsendping` tinyint(2) NOT NULL default '0',
25- `bconvertbreaks` tinyint(2) NOT NULL default '1',
26- `bdefcat` int(11) default NULL,
27- `bnotifytype` int(11) NOT NULL default '15',
28- `ballowpast` tinyint(2) NOT NULL default '0',
29- `bincludesearch` tinyint(2) NOT NULL default '0',
30- `breqemail` TINYINT( 2 ) DEFAULT '0' NOT NULL,
31- PRIMARY KEY (`bnumber`),
32- UNIQUE KEY `bnumber` (`bnumber`),
33- UNIQUE KEY `bshortname` (`bshortname`)
34-) TYPE=MyISAM;";
35- upgrade_query('Creating ' . sql_table('blog') . ' table', $query);
36- upgrade_sqlite_insert('blog',$data);
37-
38- // alter nucleus_category
39- $data=upgrade_sqlite_data('category');
40- $query = 'DROP TABLE ' . sql_table('category');
41- upgrade_query('Dropping ' . sql_table('category') . ' table', $query);
42- $query="CREATE TABLE `".sql_table(category)."` (
43- `catid` int(11) NOT NULL auto_increment,
44- `cblog` int(11) NOT NULL default '0',
45- `cname` varchar(200) default NULL,
46- `cdesc` varchar(200) default NULL,
47- PRIMARY KEY (`catid`)
48-) TYPE=MyISAM;";
49- upgrade_query('Creating ' . sql_table('category') . ' table', $query);
50- upgrade_sqlite_insert('category',$data);
51-
52- // alter nucleus_comment
53- $data=upgrade_sqlite_data('comment');
54- $query = 'DROP TABLE ' . sql_table('comment');
55- upgrade_query('Dropping ' . sql_table('comment') . ' table', $query);
56- $query="CREATE TABLE `".sql_table(comment)."` (
57- `cnumber` int(11) NOT NULL auto_increment,
58- `cbody` text NOT NULL,
59- `cuser` varchar(40) default NULL,
60- `cmail` varchar(100) default NULL,
61- `cemail` VARCHAR( 100 ),
62- `cmember` int(11) default NULL,
63- `citem` int(11) NOT NULL default '0',
64- `ctime` datetime NOT NULL default '0000-00-00 00:00:00',
65- `chost` varchar(60) default NULL,
66- `cip` varchar(15) NOT NULL default '',
67- `cblog` int(11) NOT NULL default '0',
68- PRIMARY KEY (`cnumber`),
69- UNIQUE KEY `cnumber` (`cnumber`),
70- KEY `citem` (`citem`),
71- FULLTEXT KEY `cbody` (`cbody`)
72-) TYPE=MyISAM;";
73- upgrade_query('Creating ' . sql_table('comment') . ' table', $query);
74- upgrade_sqlite_insert('comment',$data);
75-
76- // 3.2 -> 3.2+
77- // update database version
78- $query = 'UPDATE ' . sql_table('config') . ' set value=\'330\' where name=\'DatabaseVersion\'';
79- upgrade_query('Updating DatabaseVersion in config table to 330', $query);
80-
81- // nothing!
82-}
83-
84-function upgrade_sqlite_data($table){
85- $data=array();
86- $query='SELECT * FROM '.sql_table($table);
87- $res=sql_query($query);
88- while($row=nucleus_mysql_fetch_assoc($res)) $data[]=$row;
89- return $data;
90-}
91-
92-function upgrade_sqlite_insert($table,&$data){
93- echo '<li>Recovering ' . sql_table($table) . ' table';
94- $queries=array();
95- foreach($data as $rows){
96- $names='';
97- $values='';
98- foreach($rows as $key=>$value){
99- if ($names) $names.=',';
100- if ($values) $values.=',';
101- $names.="'".$key."'";
102- $values.="'".addslashes($value)."'";
103- }
104- $query='INSERT INTO '.sql_table($table).
105- ' ('.$names.')'.
106- ' VALUES ('.$values.')';
107- $queries[]=$query;
108- }
109- sql_query('begin;');
110- foreach($queries as $query) sql_query($query);
111- sql_query('commit;');
112- echo '</li>';
113-}
114-?>
Show on old repository browser