Skip to content
Newer
Older
100644 756 lines (661 sloc) 29 KB
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
1 <?php
780a345 @dbuytaert - Added some explanation to the top of the file and fixed a braino.
dbuytaert authored
2 /*
3 ** USAGE:
4 **
5 ** - Point your browser to "http://www.site.com/update.php" and follow
6 ** the instructions.
7 **
8 */
9
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
10 if (!get_cfg_var("safe_mode")) {
11 set_time_limit(180);
12 }
13
14 // Define the various updates in an array("date : comment" => "function");
15 $mysql_updates = array(
16 "2001-10-10" => "update_1",
5592761 This is a major change to the system, needs more testing!
Kjartan Mannes authored
17 "2001-10-12 : pearification" => "update_2",
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
18 "2001-10-14" => "update_3",
19 "2001-10-16" => "update_4",
20 "2001-10-17" => "update_5",
21 "2001-10-22" => "update_6",
22 "2001-11-01" => "update_7",
23 "2001-11-02" => "update_8",
24 "2001-11-04" => "update_9",
5592761 This is a major change to the system, needs more testing!
Kjartan Mannes authored
25 "2001-11-17 : distributed authentication" => "update_10",
5ecedf7 @dbuytaert user.module:
dbuytaert authored
26 "2001-12-01" => "update_11",
20b4b71 @dbuytaert - book.module:
dbuytaert authored
27 "2001-12-06" => "update_12",
e1f21d2 @dbuytaert - Included the new documentation and renamed all "referer"s to
dbuytaert authored
28 "2001-12-09" => "update_13",
a0ddc1a @dbuytaert - Added new feature. Explanation will follow on the mailing list.
dbuytaert authored
29 "2001-12-16" => "update_14",
c5bb7c3 @dbuytaert - Fixed a problem with the expiration of news items. Requires a SQL
dbuytaert authored
30 "2001-12-24" => "update_15",
a95c2a6 @dbuytaert - import.module:
dbuytaert authored
31 "2001-12-30" => "update_16",
d85e45b @dbuytaert - Added "x new comments" feature. Requires a SQL update.
dbuytaert authored
32 "2001-12-31" => "update_17",
58152c4 @dbuytaert Integrated Marco's generic/improved cache into Drupal. Requires an
dbuytaert authored
33 "2002-01-05" => "update_18",
0683331 @dbuytaert - Added an 'data' column to the user table.
dbuytaert authored
34 "2002-01-17" => "update_19",
8678951 - nodes can now be set to static which will pin them to the front pag…
Kjartan Mannes authored
35 "2002-01-27" => "update_20",
3c8de3e @dbuytaert - Changed the size of the data-field in the cache table.
dbuytaert authored
36 "2002-01-30" => "update_21",
e3d2c46 - applied search patch.
Kjartan Mannes authored
37 "2002-02-19" => "update_22",
5d9a8e3 @dbuytaert - Made the cloud module a lot more configurable: both the update inte…
dbuytaert authored
38 "2002-03-05" => "update_23",
5592761 This is a major change to the system, needs more testing!
Kjartan Mannes authored
39 "2002-04-08" => "update_24",
d8cd549 @dbuytaert - Added Marco's long-awaited taxonmy module and patches - a replacement
dbuytaert authored
40 "2002-04-14 : modules/themes web config" => "update_25",
1b573fb - book log is now saved and shown when necessary.
Kjartan Mannes authored
41 "2002-04-14 : new taxonomy system" => "update_26",
0a966e1 Updated poll.module:
Steven Wittens authored
42 "2002-04-16" => "update_27",
ae263bf @dbuytaert - Rewrote role management, splitting the table in two. There are no
dbuytaert authored
43 "2002-04-20" => "update_28",
a4b5005 - merged block and box modules. modules/box.module should be removed
Kjartan Mannes authored
44 "2002-04-23 : roles cleanup" => "update_29",
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
45 "2002-05-02" => "update_30",
39373da @dbuytaert - Added some indices.
dbuytaert authored
46 "2002-05-15" => "update_31",
e1e75f5 @dbuytaert - Update the existing variables.
dbuytaert authored
47 "2002-06-22" => "update_32",
ec59398 - feed table should have not null defined for refresh and timestamp.
Kjartan Mannes authored
48 "2002-07-07" => "update_33",
e035785 @dbuytaert - Added indices for the poll module. Patch by Marco.
dbuytaert authored
49 "2002-07-31" => "update_34",
e04f6d2 @dbuytaert - Made the rating module and its SQL table ASNI compliant. Patch by jaa.
dbuytaert authored
50 "2002-08-10" => "update_35",
bfe5b85 @dbuytaert - Applied a (modified) version of Marco's SQL sequence patch.
dbuytaert authored
51 "2002-08-16" => "update_36",
a28f818 @dbuytaert - Changed "$watchdog->message" from type "varchar(255)" to type "text".
dbuytaert authored
52 "2002-08-19" => "update_37",
9232626 @dbuytaert - Commited Marco's new comment module and forum module!!!
dbuytaert authored
53 "2002-08-26" => "update_38",
85c6e90 @dbuytaert - Made sure the sequence table is properly initialized for comments.
dbuytaert authored
54 "2002-09-15" => "update_39",
55 "2002-09-17" => "update_40"
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
56 );
57
58 // Update functions
59 function update_1() {
c71b15e - fixing the update script so it can cleanly update from 3.x to 4.0.0…
Kjartan Mannes authored
60 update_sql("ALTER TABLE users DROP INDEX real_email;");
61 update_sql("ALTER TABLE users DROP fake_email;");
62 update_sql("ALTER TABLE users DROP nodes;");
63 update_sql("ALTER TABLE users DROP bio;");
64 update_sql("ALTER TABLE users DROP hash;");
65 update_sql("ALTER TABLE users ADD jabber varchar(128) DEFAULT '' NULL;");
66 update_sql("ALTER TABLE users ADD drupal varchar(128) DEFAULT '' NULL;");
67 update_sql("ALTER TABLE users ADD init varchar(64) DEFAULT '' NULL;");
367ae7a - tweaked password changes.
Kjartan Mannes authored
68 update_sql("ALTER TABLE users CHANGE passwd pass varchar(32) DEFAULT '' NOT NULL;");
c71b15e - fixing the update script so it can cleanly update from 3.x to 4.0.0…
Kjartan Mannes authored
69 update_sql("ALTER TABLE users CHANGE real_email mail varchar(64) DEFAULT '' NULL;");
70 update_sql("ALTER TABLE users CHANGE id uid int(10) unsigned DEFAULT '0' NOT NULL auto_increment;");
71 update_sql("ALTER TABLE users CHANGE url homepage varchar(128) DEFAULT '' NOT NULL;");
72 update_sql("UPDATE users SET status = 1 WHERE status = 2;");
73 update_sql("UPDATE users SET name = userid;");
74 update_sql("ALTER TABLE users DROP userid;");
75 update_sql("UPDATE users SET init = mail;");
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
76 update_sql("DROP TABLE access;");
77 update_sql("CREATE TABLE access (aid tinyint(10) DEFAULT '0' NOT NULL auto_increment, mask varchar(255) DEFAULT '' NOT NULL, type varchar(255) DEFAULT '' NOT NULL, status tinyint(2) DEFAULT '0' NOT NULL, UNIQUE mask (mask), PRIMARY KEY (aid));");
78 update_sql("CREATE TABLE moderate (cid int(10) DEFAULT '0' NOT NULL, nid int(10) DEFAULT '0' NOT NULL, uid int(10) DEFAULT '0' NOT NULL, score int(2) DEFAULT '0' NOT NULL, timestamp int(11) DEFAULT '0' NOT NULL, INDEX (cid), INDEX (nid) );");
79 update_sql("ALTER TABLE comments DROP score;");
80 update_sql("ALTER TABLE comments DROP votes;");
81 update_sql("ALTER TABLE comments DROP users;");
82 }
83
84 function update_2() {
85 update_sql("ALTER TABLE users CHANGE pass pass varchar(32) DEFAULT '' NOT NULL;");
86 update_sql("ALTER TABLE rating CHANGE user userid int(10) DEFAULT '0' NOT NULL;");
87 update_sql("ALTER TABLE layout CHANGE user userid int(10) DEFAULT '0' NOT NULL;");
88 update_sql("ALTER TABLE blocks CHANGE offset delta tinyint(2) DEFAULT '0' NOT NULL;");
89 foreach (module_list() as $name) {
90 if (module_hook($name, "node", "name")) {
91 $output .= "$name ...";
92 db_query("DROP TABLE IF EXISTS ". $name ."_seq");
93 db_query("CREATE TABLE ". $name ."_seq (id INTEGER UNSIGNED AUTO_INCREMENT NOT NULL, PRIMARY KEY(id))");
4a28077 - adding descriptions to modules (thanks Joe + Scott).
Kjartan Mannes authored
94 $result = db_query("SELECT MAX(". ($name == "node" ? "nid" : "lid") .") FROM $name");
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
95 $count = $result ? db_result($result, 0) : 0;
96 db_query("INSERT INTO ". $name ."_seq (id) VALUES ('$count')");
97 $output .= "done ($count)<br />";
98 }
99 }
100 print $output;
101 }
102
103 function update_3() {
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
104 update_sql("ALTER TABLE user RENAME users;");
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
105 update_sql("ALTER TABLE locales CHANGE id lid int(10) DEFAULT '0' NOT NULL auto_increment;");
106 update_sql("ALTER TABLE layout CHANGE userid uid int(10) DEFAULT '0' NOT NULL;");
107 update_sql("ALTER TABLE rating CHANGE userid uid int(10) DEFAULT '0' NOT NULL;");
108 }
109
110 function update_4() {
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
111 print "remove the \"auto_increment\"s:<br />";
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
112 update_sql("ALTER TABLE story CHANGE nid nid int(10) unsigned DEFAULT '0' NOT NULL;");
113 update_sql("ALTER TABLE blog CHANGE nid nid int(10) unsigned DEFAULT '0' NOT NULL;");
114 update_sql("ALTER TABLE page CHANGE nid nid int(10) unsigned DEFAULT '0' NOT NULL;");
115 update_sql("ALTER TABLE forum CHANGE nid nid int(10) unsigned DEFAULT '0' NOT NULL;");
116 update_sql("ALTER TABLE book CHANGE nid nid int(10) unsigned DEFAULT '0' NOT NULL;");
117
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
118 print "drop the \"lid\"s:<br />";
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
119 update_sql("ALTER TABLE story DROP lid;");
120 update_sql("ALTER TABLE blog DROP lid;");
121 update_sql("ALTER TABLE page DROP lid;");
122 update_sql("ALTER TABLE forum DROP lid;");
123 update_sql("ALTER TABLE book DROP lid;");
124
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
125 print "rename \"author\" to \"uid\":<br />";
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
126 update_sql("ALTER TABLE comments CHANGE author uid int(10) DEFAULT '0' NOT NULL;");
127 update_sql("ALTER TABLE node CHANGE author uid int(10) DEFAULT '0' NOT NULL;");
128 update_sql("ALTER TABLE node DROP KEY author;");
129 update_sql("ALTER TABLE node ADD KEY uid (uid);");
130
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
131 print "resize some \"id\"s:<br />";
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
132 update_sql("ALTER TABLE feed CHANGE fid fid int(10) NOT NULL auto_increment;");
133 update_sql("ALTER TABLE bundle CHANGE bid bid int(10) NOT NULL auto_increment;");
134 update_sql("ALTER TABLE item CHANGE iid iid int(10) NOT NULL auto_increment;");
135 update_sql("ALTER TABLE item CHANGE fid fid int(10) NOT NULL;");
136 update_sql("ALTER TABLE comments CHANGE cid cid int(10) NOT NULL auto_increment;");
137 update_sql("ALTER TABLE comments CHANGE pid pid int(10) NOT NULL;");
138 update_sql("ALTER TABLE comments CHANGE lid lid int(10) NOT NULL;");
139 }
140
141 function update_5() {
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
142 print "add primary keys:<br />";
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
143 update_sql("ALTER TABLE story ADD PRIMARY KEY nid (nid);");
144 update_sql("ALTER TABLE blog ADD PRIMARY KEY nid (nid);");
145 update_sql("ALTER TABLE page ADD PRIMARY KEY nid (nid);");
146 update_sql("ALTER TABLE forum ADD PRIMARY KEY nid (nid);");
147 update_sql("ALTER TABLE book ADD PRIMARY KEY nid (nid);");
148
149 }
150
151 function update_6() {
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
152 print "add new field to blocks:<br />";
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
153 update_sql("ALTER TABLE blocks ADD path varchar(255) NOT NULL DEFAULT '';");
154 }
155
156 function update_7() {
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
157 print "updating the story table:<br />";
6fd5a8d @dbuytaert - update.php: discovered and fixed a small thinko in update function #7.
dbuytaert authored
158 update_sql("UPDATE story SET body = CONCAT(abstract, '\n\n', body)");
159
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
160 print "rename the body fields:<br />";
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
161 update_sql("ALTER TABLE story CHANGE body body_old TEXT DEFAULT '' NOT NULL;");
162 update_sql("ALTER TABLE page CHANGE body body_old TEXT DEFAULT '' NOT NULL;");
163 update_sql("ALTER TABLE blog CHANGE body body_old TEXT DEFAULT '' NOT NULL;");
164 update_sql("ALTER TABLE forum CHANGE body body_old TEXT DEFAULT '' NOT NULL;");
165 update_sql("ALTER TABLE book CHANGE body body_old TEXT DEFAULT '' NOT NULL;");
166
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
167 print "update the node table:<br />";
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
168 update_sql("ALTER TABLE node DROP lid;");
169 update_sql("ALTER TABLE node ADD teaser TEXT DEFAULT '' NOT NULL;");
170 update_sql("ALTER TABLE node ADD body TEXT DEFAULT '' NOT NULL;");
171 update_sql("ALTER TABLE node ADD changed int(11) DEFAULT '0' NOT NULL;");
172 update_sql("ALTER TABLE node CHANGE timestamp created int(11) DEFAULT '0' NOT NULL;");
173 update_sql("ALTER TABLE node CHANGE comment comment int(2) DEFAULT '0' NOT NULL;");
174 update_sql("ALTER TABLE node CHANGE promote promote int(2) DEFAULT '0' NOT NULL;");
175 update_sql("ALTER TABLE node CHANGE moderate moderate int(2) DEFAULT '0' NOT NULL;");
176 update_sql("ALTER TABLE node DROP timestamp_posted;");
177 update_sql("ALTER TABLE node DROP timestamp_queued;");
178 update_sql("ALTER TABLE node DROP timestamp_hidden;");
179 update_sql("UPDATE node SET status = 0 WHERE status = 1;");
180 update_sql("UPDATE node SET status = 0 WHERE status = 2;");
181 update_sql("UPDATE node SET status = 1 WHERE status = 3;");
182
c71b15e - fixing the update script so it can cleanly update from 3.x to 4.0.0…
Kjartan Mannes authored
183 $result = db_query("SELECT nid,type FROM node WHERE type = 'story' OR type = 'page' OR type = 'blog' OR type = 'forum' OR type = 'book'");
184 include_once("modules/node.module");
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
185
186 while ($object = db_fetch_object($result)) {
187
c71b15e - fixing the update script so it can cleanly update from 3.x to 4.0.0…
Kjartan Mannes authored
188 include_once("modules/$object->type.module");
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
189 $node = node_load(array("nid" => $object->nid));
190
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
191 $old = db_fetch_object(db_query("SELECT * FROM $node->type WHERE nid = $node->nid"));
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
192
193 switch ($node->type) {
194 case "forum":
195 case "story":
196 case "book":
197 case "page":
198 case "blog":
c8d126b - bug fix
Kjartan Mannes authored
199 node_save($node, array("nid", "body" => $old->body_old, "teaser" => ($old->abstract ? $old->abstract : node_teaser($old->body_old))));
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
200 print "updated node $node->nid '$node->title' ($node->type)<br />";
201 break;
202 default:
203 print "unknown node $node->nid '$node->title' ($node->type)<br />";
204 }
205
206 unset($node);
207 unset($body);
208 }
209
d92e3c1 - fixed old node abstracts being wiped.
Kjartan Mannes authored
210 update_sql("UPDATE node SET changed = created;");
211 update_sql("ALTER TABLE story DROP abstract;");
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
212 update_sql("ALTER TABLE book DROP section;");
213 }
214
215 function update_8() {
216 update_sql("ALTER TABLE node ADD revisions TEXT DEFAULT '' NOT NULL;");
217 }
218
219 function update_9() {
220 update_sql("ALTER TABLE book ADD revision int(2) DEFAULT '1' NOT NULL;");
221 update_sql("ALTER TABLE book DROP log;");
222 update_sql("ALTER TABLE book DROP pid;");
223
224 // remove book pages that used to be 'expired':
225 $result = db_query("SELECT n.nid, n.title FROM node n WHERE n.type = 'book' AND n.status = 0");
226 while ($node = db_fetch_object($result)) {
227 print "removing node $node->nid '$node->title' (dumped node)<br />";
228 db_query("DELETE FROM node WHERE nid = '$node->nid'");
229 db_query("DELETE FROM book WHERE nid = '$node->nid'");
230 db_query("DELETE FROM comments WHERE lid = '$node->nid'");
231 }
232 }
233
cd2df44 @dbuytaert - update.php:
dbuytaert authored
234 function update_10() {
235 // create a new table:
236 update_sql("CREATE TABLE authmap (
237 aid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
238 uid int(10) DEFAULT '' NOT NULL,
239 authname varchar(128) DEFAULT '' NOT NULL,
240 module varchar(128) DEFAULT '' NOT NULL,
241 UNIQUE authname (authname),
242 PRIMARY KEY (aid)
243 );");
244
245 // populate the new table:
246 $result = db_query("SELECT uid, name, jabber, drupal FROM users WHERE jabber != '' || drupal != ''");
247 while ($user = db_fetch_object($result)) {
248 if ($user->jabber) {
249 update_sql("INSERT INTO authmap (uid, authname, module) VALUES ('$user->uid', '$user->jabber', 'jabber')");
250 }
251 if ($user->drupal) {
252 update_sql("INSERT INTO authmap (uid, authname, module) VALUES ('$user->uid', '$user->drupal', 'drupal')");
253 }
254 }
255
256 // remove the old user-table leftovers:
257 update_sql("DELETE FROM variable WHERE name = 'user_jabber'");
258 update_sql("DELETE FROM variable WHERE name = 'user_drupal'");
259 update_sql("ALTER TABLE users DROP drupal");
260 update_sql("ALTER TABLE users DROP jabber");
261
262 // remove the old node-table leftovers:
263 update_sql("ALTER TABLE forum DROP body_old;");
264 update_sql("ALTER TABLE story DROP body_old;");
265 update_sql("ALTER TABLE book DROP body_old;");
266 update_sql("ALTER TABLE page DROP body_old;");
267 update_sql("ALTER TABLE blog DROP body_old;");
268 }
269
5ecedf7 @dbuytaert user.module:
dbuytaert authored
270 function update_11() {
271 update_sql("ALTER TABLE users ADD session TEXT;");
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
272 update_sql("ALTER TABLE users ADD sid varchar(32) DEFAULT '' NOT NULL;");
5ecedf7 @dbuytaert user.module:
dbuytaert authored
273 }
274
20b4b71 @dbuytaert - book.module:
dbuytaert authored
275 function update_12() {
276 update_sql("ALTER TABLE book DROP revision;");
277 update_sql("ALTER TABLE book ADD format tinyint(2) DEFAULT '0';");
278 }
279
780a345 @dbuytaert - Added some explanation to the top of the file and fixed a braino.
dbuytaert authored
280 function update_13() {
281 update_sql("ALTER TABLE referer RENAME AS referrer;");
282 update_sql("DROP TABLE blog;");
283 update_sql("DROP TABLE story;");
284 update_sql("DROP TABLE forum;");
285 }
286
a0ddc1a @dbuytaert - Added new feature. Explanation will follow on the mailing list.
dbuytaert authored
287 function update_14() {
288 update_sql("CREATE TABLE directory (
289 link varchar(255) DEFAULT '' NOT NULL,
290 name varchar(128) DEFAULT '' NOT NULL,
291 mail varchar(128) DEFAULT '' NOT NULL,
292 slogan text NOT NULL,
293 mission text NOT NULL,
294 timestamp int(11) DEFAULT '0' NOT NULL,
295 PRIMARY KEY (link)
296 );");
e1f21d2 @dbuytaert - Included the new documentation and renamed all "referer"s to
dbuytaert authored
297 }
298
c5bb7c3 @dbuytaert - Fixed a problem with the expiration of news items. Requires a SQL
dbuytaert authored
299 function update_15() {
300 update_sql("ALTER TABLE feed DROP uncache;");
301 }
302
a95c2a6 @dbuytaert - import.module:
dbuytaert authored
303 function update_16() {
304 update_sql("ALTER TABLE comments CHANGE lid nid int(10) NOT NULL;");
305 }
306
d85e45b @dbuytaert - Added "x new comments" feature. Requires a SQL update.
dbuytaert authored
307 function update_17() {
308 update_sql("CREATE TABLE history (
309 uid int(10) DEFAULT '0' NOT NULL,
310 nid int(10) DEFAULT '0' NOT NULL,
311 timestamp int(11) DEFAULT '0' NOT NULL,
312 PRIMARY KEY (uid, nid)
313 );");
314 }
315
58152c4 @dbuytaert Integrated Marco's generic/improved cache into Drupal. Requires an
dbuytaert authored
316 function update_18() {
317 update_sql("ALTER TABLE cache CHANGE timestamp expire int(11) DEFAULT '0' NOT NULL;");
318 update_sql("ALTER TABLE cache CHANGE url cid varchar(255) DEFAULT '' NOT NULL;");
319 }
320
0683331 @dbuytaert - Added an 'data' column to the user table.
dbuytaert authored
321 function update_19() {
322 update_sql("ALTER TABLE users ADD data TEXT;");
323 }
324
dc8f6be - added default value to enable user block to update.php
Kjartan Mannes authored
325 function update_20() {
326 update_sql("INSERT INTO blocks SET name='User information', module='user', delta='0', status='2', weight='0', region='1', remove='0', path='';");
327 }
328
8678951 - nodes can now be set to static which will pin them to the front pag…
Kjartan Mannes authored
329 function update_21() {
330 update_sql("ALTER TABLE node ADD static int(2) DEFAULT '0' NOT NULL;");
331 }
332
3c8de3e @dbuytaert - Changed the size of the data-field in the cache table.
dbuytaert authored
333 function update_22() {
334 update_sql("ALTER TABLE cache MODIFY data MEDIUMTEXT;");
335 }
336
e3d2c46 - applied search patch.
Kjartan Mannes authored
337 function update_23() {
68129fd @dbuytaert - Changed some "default NULL"s to "default NOT NULL"s as this only wo…
dbuytaert authored
338 update_sql("CREATE TABLE search_index (word varchar(50) default NOT NULL, lno int(10) unsigned default NOT NULL, type varchar(16) default NOT NULL, count int(10) unsigned default NOT NULL, KEY lno (lno), KEY word (word));");
e3d2c46 - applied search patch.
Kjartan Mannes authored
339 }
340
5d9a8e3 @dbuytaert - Made the cloud module a lot more configurable: both the update inte…
dbuytaert authored
341 function update_24() {
342 update_sql("ALTER TABLE site ADD refresh int(11) NOT NULL;");
343 update_sql("ALTER TABLE site ADD threshold int(11) NOT NULL;");
344 update_sql("UPDATE site SET refresh = '7200';");
4a28077 - adding descriptions to modules (thanks Joe + Scott).
Kjartan Mannes authored
345 update_sql("UPDATE site SET threshold = '60';");
5d9a8e3 @dbuytaert - Made the cloud module a lot more configurable: both the update inte…
dbuytaert authored
346 }
347
5592761 This is a major change to the system, needs more testing!
Kjartan Mannes authored
348 function update_25() {
d8cd549 @dbuytaert - Added Marco's long-awaited taxonmy module and patches - a replacement
dbuytaert authored
349 update_sql("UPDATE users SET theme = LOWER(theme);");
350 }
351
352 function update_26() {
353 update_sql("CREATE TABLE vocabulary (
354 vid int UNSIGNED NOT NULL PRIMARY KEY auto_increment,
355 name varchar(255) NOT NULL,
356 description TEXT,
357 relations TINYINT UNSIGNED NOT NULL,
358 hierarchy TINYINT UNSIGNED NOT NULL,
359 multiple TINYINT UNSIGNED NOT NULL,
360 required TINYINT UNSIGNED NOT NULL,
361 types TEXT,
362 weight TINYINT NOT NULL);");
363
364 update_sql("CREATE TABLE term_data (
365 tid int UNSIGNED NOT NULL PRIMARY KEY auto_increment,
366 vid int UNSIGNED NOT NULL,
367 name varchar(255) NOT NULL,
368 description TEXT,
369 weight TINYINT NOT NULL);");
370
371 update_sql("CREATE TABLE term_hierarchy (
372 tid int UNSIGNED NOT NULL,
373 parent int UNSIGNED NOT NULL
374 );");
375
376 update_sql("CREATE TABLE term_relation (
377 tid1 int UNSIGNED NOT NULL,
378 tid2 int UNSIGNED NOT NULL
379 );");
380
381 update_sql("CREATE TABLE term_synonym (
382 tid int UNSIGNED NOT NULL,
383 name varchar(255) NOT NULL
384 );");
385
386 update_sql("CREATE TABLE term_node (
387 nid int UNSIGNED NOT NULL,
388 tid int UNSIGNED NOT NULL
389 );");
390
391 update_sql("ALTER TABLE term_data ADD INDEX (vid);");
392 update_sql("ALTER TABLE term_hierarchy ADD INDEX (tid);");
393 update_sql("ALTER TABLE term_hierarchy ADD INDEX (parent);");
394 update_sql("ALTER TABLE term_relation ADD INDEX (tid1);");
395 update_sql("ALTER TABLE term_relation ADD INDEX (tid2);");
396 update_sql("ALTER TABLE term_synonym ADD INDEX (tid);");
397 update_sql("ALTER TABLE term_synonym ADD INDEX (name(3));");
398 update_sql("ALTER TABLE term_node ADD INDEX (nid);");
399 update_sql("ALTER TABLE term_node ADD INDEX (tid);");
86552cb - changed block, module and theme config pages to use checkboxes.
Kjartan Mannes authored
400 update_sql("UPDATE node SET comment = 2 WHERE comment = 1");
5592761 This is a major change to the system, needs more testing!
Kjartan Mannes authored
401 }
402
1b573fb - book log is now saved and shown when necessary.
Kjartan Mannes authored
403 function update_27() {
404 update_sql("ALTER TABLE book ADD log TEXT;");
405 }
406
0a966e1 Updated poll.module:
Steven Wittens authored
407 function update_28() {
408 update_sql("ALTER TABLE poll DROP lid;");
409 }
410
ae263bf @dbuytaert - Rewrote role management, splitting the table in two. There are no
dbuytaert authored
411 function update_29() {
412 update_sql("INSERT INTO permission (rid, perm) SELECT rid, perm FROM role");
413
414 $result = db_query("SELECT rid, name FROM role");
415 while ($role = db_fetch_object($result)) {
f38860f - updated the updates.
Kjartan Mannes authored
416 update_sql("UPDATE users SET rid = ". $role->rid ." WHERE role = '". $role->name ."'");
ae263bf @dbuytaert - Rewrote role management, splitting the table in two. There are no
dbuytaert authored
417 }
418
419 update_sql("ALTER TABLE users DROP role");
420 update_sql("ALTER TABLE role DROP perm");
421 }
422
a4b5005 - merged block and box modules. modules/box.module should be removed
Kjartan Mannes authored
423 function update_30() {
424 update_sql("ALTER TABLE blocks ADD custom tinyint(2) not null;");
425 update_sql("UPDATE blocks SET module = 'block' WHERE module = 'boxes';");
426 update_sql("UPDATE blocks SET status = 1, custom = 1 WHERE status = 1;");
427 update_sql("UPDATE blocks SET status = 1, custom = 0 WHERE status = 2;");
428 }
429
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
430 function update_31() {
431 include_once("modules/taxonomy.module");
f3c8757 @dbuytaert - Ran the code through 'scripts/code-clean.sh': removed trailing whit…
dbuytaert authored
432
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
433 print "Wiping tables.<br />";
367ae7a - tweaked password changes.
Kjartan Mannes authored
434 /*db_query("DELETE FROM vocabulary");
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
435 db_query("DELETE FROM term_data");
436 db_query("DELETE FROM term_node");
367ae7a - tweaked password changes.
Kjartan Mannes authored
437 db_query("DELETE FROM term_hierarchy");**/
f3c8757 @dbuytaert - Ran the code through 'scripts/code-clean.sh': removed trailing whit…
dbuytaert authored
438
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
439 print "Creating collections.<br />";
367ae7a - tweaked password changes.
Kjartan Mannes authored
440 $offset = db_result(db_query("SELECT MAX(vid) AS high FROM vocabulary"), 0);
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
441 $result = db_query("SELECT * FROM collection");
442 while ($c = db_fetch_object($result)) {
367ae7a - tweaked password changes.
Kjartan Mannes authored
443 $offset++;
444 $collections[$c->name] = $offset;
445 db_query("INSERT INTO vocabulary SET vid = '$offset', name = '$c->name', types = '". str_replace(" ", "", $c->types) ."'");
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
446 }
f3c8757 @dbuytaert - Ran the code through 'scripts/code-clean.sh': removed trailing whit…
dbuytaert authored
447
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
448 print "Creating terms.<br />";
449 $result = db_query("SELECT * FROM tag");
367ae7a - tweaked password changes.
Kjartan Mannes authored
450 $i = db_result(db_query("SELECT MAX(tid) AS high FROM term_data"), 0) + 1;
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
451 while ($t = db_fetch_object($result)) {
452 foreach (explode(", ", $t->collections) as $c) {
453 if ($collections[$c]) {
454 db_query("INSERT INTO term_data SET tid = '$i', vid = '$collections[$c]', name = '$t->name'");
455 db_query("INSERT INTO term_hierarchy SET tid = '$i', parent = '0'");
456 $terms[$t->name] = $i;
457 $i++;
458 }
459 }
460 }
f3c8757 @dbuytaert - Ran the code through 'scripts/code-clean.sh': removed trailing whit…
dbuytaert authored
461
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
462 print "Linking nodes with terms.<br />";
463 $result = db_query("SELECT nid,attributes FROM node WHERE attributes != ''");
464 while ($node = db_fetch_object($result)) {
87cdd89 - attempting to fix tag -> tax conversion.
Kjartan Mannes authored
465 $tag = db_fetch_object(db_query("SELECT name FROM tag WHERE attributes = '$node->attributes'"));
466 $tag = trim($tag->name);
467 if ($tag) {
468 if ($terms[$tag]) {
469 db_query("INSERT INTO term_node SET nid = '$node->nid', tid = '$terms[$tag]'");
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
470 }
87cdd89 - attempting to fix tag -> tax conversion.
Kjartan Mannes authored
471 else {
472 $errors[$tag] = "$tag";
473 }
474 }
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
475 }
f3c8757 @dbuytaert - Ran the code through 'scripts/code-clean.sh': removed trailing whit…
dbuytaert authored
476
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
477 if (count($errors)) {
478 asort($errors);
479 print "<br /><br />Terms not found:<br /><pre> ". implode("\n ", $errors) ."</pre>";
480 }
f3c8757 @dbuytaert - Ran the code through 'scripts/code-clean.sh': removed trailing whit…
dbuytaert authored
481
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
482 // Clean up meta tag system
4a28077 - adding descriptions to modules (thanks Joe + Scott).
Kjartan Mannes authored
483 update_sql("DROP TABLE collection");
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
484 update_sql("DROP TABLE tag");
4a28077 - adding descriptions to modules (thanks Joe + Scott).
Kjartan Mannes authored
485 update_sql("ALTER TABLE node DROP attributes");
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
486 }
487
39373da @dbuytaert - Added some indices.
dbuytaert authored
488 function update_32() {
ec59398 - feed table should have not null defined for refresh and timestamp.
Kjartan Mannes authored
489 update_sql("ALTER TABLE users ADD index (sid(4));");
39373da @dbuytaert - Added some indices.
dbuytaert authored
490 update_sql("ALTER TABLE users ADD index (timestamp);");
491 }
492
e1e75f5 @dbuytaert - Update the existing variables.
dbuytaert authored
493 function update_33() {
494 $result = db_query("SELECT * FROM variable WHERE value NOT LIKE 's:%;';");
ec59398 - feed table should have not null defined for refresh and timestamp.
Kjartan Mannes authored
495 // NOTE: the "WHERE"-part of the query above avoids variables to get serialized twice.
e1e75f5 @dbuytaert - Update the existing variables.
dbuytaert authored
496 while ($variable = db_fetch_object($result)) {
497 variable_set($variable->name, $variable->value);
498 }
499 }
500
ec59398 - feed table should have not null defined for refresh and timestamp.
Kjartan Mannes authored
501 function update_34() {
502 update_sql("ALTER TABLE feed MODIFY refresh int(10) NOT NULL default '0';");
503 update_sql("ALTER TABLE feed MODIFY timestamp int (10) NOT NULL default '0';");
504 }
505
e035785 @dbuytaert - Added indices for the poll module. Patch by Marco.
dbuytaert authored
506 function update_35() {
507 update_sql("ALTER TABLE poll_choices ADD INDEX (nid);");
508 }
509
e04f6d2 @dbuytaert - Made the rating module and its SQL table ASNI compliant. Patch by jaa.
dbuytaert authored
510 function update_36() {
511 update_sql("ALTER TABLE rating CHANGE old previous int(6) NOT NULL default '0';");
512 update_sql("ALTER TABLE rating CHANGE new current int(6) NOT NULL default '0';");
513 }
514
bfe5b85 @dbuytaert - Applied a (modified) version of Marco's SQL sequence patch.
dbuytaert authored
515 function update_37() {
516
517 update_sql("DROP TABLE IF EXISTS sequences;");
518
519 update_sql("CREATE TABLE sequences (
a28f818 @dbuytaert - Changed "$watchdog->message" from type "varchar(255)" to type "text".
dbuytaert authored
520 name VARCHAR(255) NOT NULL PRIMARY KEY,
bfe5b85 @dbuytaert - Applied a (modified) version of Marco's SQL sequence patch.
dbuytaert authored
521 id INT UNSIGNED NOT NULL
522 ) TYPE=MyISAM;");
523
524 if ($max = db_result(db_query("SELECT MAX(nid) FROM node;"))) {
525 update_sql("REPLACE INTO sequences VALUES ('node', $max);");
526 }
527
528 if ($max = db_result(db_query("SELECT MAX(cid) FROM comments;"))) {
529 update_sql("REPLACE INTO sequences VALUES ('comments', $max);");
530 }
531 // NOTE: move the comments bit down as soon as we switched to use the new comment module!
532
533 if ($max = db_result(db_query("SELECT MAX(tid) FROM term_data;"))) {
534 update_sql("REPLACE INTO sequences VALUES ('term_data', $max);");
535 }
536 }
537
a28f818 @dbuytaert - Changed "$watchdog->message" from type "varchar(255)" to type "text".
dbuytaert authored
538 function update_38() {
539 update_sql("ALTER TABLE watchdog CHANGE message message text NOT NULL default '';");
540 }
541
9232626 @dbuytaert - Commited Marco's new comment module and forum module!!!
dbuytaert authored
542 function update_39() {
543 update_sql("DROP TABLE moderate");
544
545 update_sql("ALTER TABLE comments ADD score MEDIUMINT NOT NULL;");
546 update_sql("ALTER TABLE comments ADD status TINYINT UNSIGNED NOT NULL;");
547 update_sql("ALTER TABLE comments ADD users MEDIUMTEXT;");
548
549 update_sql("CREATE TABLE moderation_votes (
550 mid INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
551 vote VARCHAR(255),
552 weight TINYINT NOT NULL
553 );");
554
555 update_sql("CREATE TABLE moderation_roles (
556 rid INT UNSIGNED NOT NULL,
557 mid INT UNSIGNED NOT NULL,
558 value TINYINT NOT NULL
559 );");
560
561 update_sql("ALTER TABLE moderation_roles ADD INDEX (rid);");
562 update_sql("ALTER TABLE moderation_roles ADD INDEX (mid);");
563
564 update_sql("CREATE TABLE moderation_filters (
565 fid INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
566 filter VARCHAR(255) NOT NULL,
567 minimum SMALLINT NOT NULL
568 );");
569
570 update_sql("DELETE FROM moderation_votes;");
571 update_sql("INSERT INTO moderation_votes VALUES (1, '+1', 0);");
572 update_sql("INSERT INTO moderation_votes VALUES (2, '-1', 1);");
573
574 update_sql("DELETE FROM moderation_roles;");
575 update_sql("INSERT INTO moderation_roles VALUES (2, 1, 1);");
576 update_sql("INSERT INTO moderation_roles VALUES (2, 2, -1);");
577
578 update_sql("CREATE TABLE forum (
579 nid int unsigned not null primary key,
580 icon varchar(255) not null,
581 shadow int unsigned not null
582 );");
583 }
584
85c6e90 @dbuytaert - Made sure the sequence table is properly initialized for comments.
dbuytaert authored
585 function update_40() {
586 if ($max = db_result(db_query("SELECT MAX(cid) FROM comments;"))) {
587 update_sql("REPLACE INTO sequences VALUES ('comments', $max);");
588 }
589 }
590
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
591 function update_upgrade3() {
592 update_sql("INSERT INTO system VALUES ('archive.module','archive','module','',1);");
593 update_sql("INSERT INTO system VALUES ('block.module','block','module','',1);");
594 update_sql("INSERT INTO system VALUES ('blog.module','blog','module','',1);");
595 update_sql("INSERT INTO system VALUES ('book.module','book','module','',1);");
596 update_sql("INSERT INTO system VALUES ('cloud.module','cloud','module','',1);");
597 update_sql("INSERT INTO system VALUES ('comment.module','comment','module','',1);");
598 update_sql("INSERT INTO system VALUES ('forum.module','forum','module','',1);");
599 update_sql("INSERT INTO system VALUES ('help.module','help','module','',1);");
600 update_sql("INSERT INTO system VALUES ('import.module','import','module','',1);");
601 update_sql("INSERT INTO system VALUES ('locale.module','locale','module','',1);");
602 update_sql("INSERT INTO system VALUES ('node.module','node','module','',1);");
603 update_sql("INSERT INTO system VALUES ('page.module','page','module','',1);");
604 update_sql("INSERT INTO system VALUES ('poll.module','poll','module','',1);");
605 update_sql("INSERT INTO system VALUES ('queue.module','queue','module','',1);");
606 update_sql("INSERT INTO system VALUES ('rating.module','rating','module','',1);");
607 update_sql("INSERT INTO system VALUES ('search.module','search','module','',1);");
608 update_sql("INSERT INTO system VALUES ('statistics.module','statistics','module','',1);");
609 update_sql("INSERT INTO system VALUES ('story.module','story','module','',1);");
610 update_sql("INSERT INTO system VALUES ('taxonomy.module','taxonomy','module','',1);");
611 update_sql("INSERT INTO system VALUES ('themes/example/example.theme','example','theme','Internet explorer, Netscape, Opera, Lynx',1);");
612 update_sql("INSERT INTO system VALUES ('themes/goofy/goofy.theme','goofy','theme','Internetexplorer, Netscape, Opera',1);");
613 update_sql("INSERT INTO system VALUES ('themes/marvin/marvin.theme','marvin','theme','Internet explorer, Netscape, Opera',1);");
614 update_sql("INSERT INTO system VALUES ('themes/unconed/unconed.theme','unconed','theme','Internet explorer, Netscape, Opera',1);");
615 update_sql("INSERT INTO system VALUES ('tracker.module','tracker','module','',1);");
616 update_sql("REPLACE variable SET value = 'marvin', name = 'theme_default';");
617 update_sql("REPLACE blocks SET name = 'User information', module = 'user', delta = '0', status = '1';");
618 update_sql("REPLACE blocks SET name = 'Log in', module = 'user', delta = '1', status = '1';");
619 }
620
58152c4 @dbuytaert Integrated Marco's generic/improved cache into Drupal. Requires an
dbuytaert authored
621 /*
622 ** System functions
623 */
624
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
625 function update_sql($sql) {
626 global $edit;
f38860f - updated the updates.
Kjartan Mannes authored
627 print nl2br(htmlentities($sql)) ." ";
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
628 $result = db_query($sql);
629 if ($result) {
630 print "<font color=\"green\">OK</font>\n";
631 return 1;
632 }
633 else {
634 print "<font color=\"red\">FAILED</font>\n";
635 if ($edit["bail"]) {
636 die("Fatal error. Bailing");
637 }
638 return 0;
639 }
640 }
641
642 function update_data($start) {
643 global $mysql_updates;
644 $mysql_updates = array_slice($mysql_updates, ($start-- ? $start : 0));
86552cb - changed block, module and theme config pages to use checkboxes.
Kjartan Mannes authored
645 foreach ($mysql_updates as $date => $func) {
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
646 print "<b>$date</b><br />\n<pre>\n";
647 $func();
648 variable_set("update_start", $date);
649 print "</pre>\n";
650 }
651 }
652
653 function update_page() {
654 global $op, $edit, $user, $mysql_updates;
655
656 switch ($op) {
657 case "Update":
658 // make sure we have updates to run.
497ab79 - added notes to update.php which you will see before you can perform…
Kjartan Mannes authored
659 print "<html><h1>Drupal update</h1>";
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
660 print "<b>&raquo; <a href=\"index.php\">home</a></b><br />\n";
661 print "<b>&raquo; <a href=\"admin.php\">administer</a></b><br />\n";
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
662 if ($edit["start"] == -1) {
663 print "No updates to perform.";
664 }
665 else {
666 update_data($edit["start"]);
667 }
497ab79 - added notes to update.php which you will see before you can perform…
Kjartan Mannes authored
668 print "</html>";
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
669 break;
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
670 case "upgrade3":
671 // make sure we have updates to run.
672 print "<html><h1>Drupal upgrade</h1>";
673 print "<b>&raquo; <a href=\"index.php\">home</a></b><br />\n";
674 print "<b>&raquo; <a href=\"admin.php\">administer</a></b><br />\n";
675 if ($edit["start"] == -1) {
676 print "No updates to perform.";
677 }
678 else {
679 update_data($edit["start"]);
680 }
681 print "<pre>\n";
682 update_upgrade3();
683 print "</pre>\n";
684 print "</html>";
685 break;
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
686 default:
687 $start = variable_get("update_start", 0);
688 $dates[] = "All";
689 $i = 1;
86552cb - changed block, module and theme config pages to use checkboxes.
Kjartan Mannes authored
690 foreach ($mysql_updates as $date => $sql) {
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
691 $dates[$i++] = $date;
692 if ($date == $start) {
693 $selected = $i;
694 }
695 }
696 $dates[$i] = "None";
697
698 // make update form and output it.
699 $form .= form_select("Perform updates since", "start", (isset($selected) ? $selected : -1), $dates);
f38860f - updated the updates.
Kjartan Mannes authored
700 $form .= form_select("Stop on errors", "bail", 0, array("Disabled", "Enabled"), "Don't forget to backup your database before performing an update.");
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
701 $form .= form_submit("Update");
497ab79 - added notes to update.php which you will see before you can perform…
Kjartan Mannes authored
702 print "<html><h1>Drupal update</h1>";
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
703 print form($form);
497ab79 - added notes to update.php which you will see before you can perform…
Kjartan Mannes authored
704 print "</html>";
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
705 break;
706 }
707 }
708
497ab79 - added notes to update.php which you will see before you can perform…
Kjartan Mannes authored
709 function update_info() {
710 print "<html><h1>Drupal update</h1>";
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
711 print "<h2>Instructions</h2>\n";
712 print "<ol>\n";
367ae7a - tweaked password changes.
Kjartan Mannes authored
713 print "<li><p>Before doing anything backup your database. This process will change your database and its values, and some things might get lost.</p></li>\n";
714 print "<li><p>Don't run this script twice as it will cause some serious problems!</p></li>\n";
4a28077 - adding descriptions to modules (thanks Joe + Scott).
Kjartan Mannes authored
715 print "<li>Before doing anything else these queries have to be run manually:<br />\n";
497ab79 - added notes to update.php which you will see before you can perform…
Kjartan Mannes authored
716 print "<pre>\n";
717 print "ALTER TABLE watchdog CHANGE user uid int(10) DEFAULT '0' NOT NULL;\n";
718 print "ALTER TABLE watchdog CHANGE id wid int(5) DEFAULT '0' NOT NULL auto_increment;\n";
719 print "ALTER TABLE users ADD sid varchar(32) DEFAULT '' NOT NULL;\n";
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
720 print "ALTER TABLE users ADD session TEXT;\n";
497ab79 - added notes to update.php which you will see before you can perform…
Kjartan Mannes authored
721 print "ALTER TABLE users CHANGE last_host hostname varchar(128) DEFAULT '' NOT NULL;\n";
722 print "ALTER TABLE users CHANGE last_access timestamp int(11) DEFAULT '0' NOT NULL;\n";
723 print "CREATE TABLE system (filename varchar(255) NOT NULL default '', name varchar(255) NOT NULL default '', type varchar(255) NOT NULL default '', description varchar(255) NOT NULL default '', status int(2) NOT NULL default '0', PRIMARY KEY (filename));\n";
724 print "CREATE TABLE permission (rid INT UNSIGNED NOT NULL, perm TEXT, tid INT UNSIGNED NOT NULL, KEY (rid));\n";
725 print "INSERT INTO permission (rid, perm) SELECT rid, perm FROM role;\n";
726 print "ALTER TABLE users ADD rid INT UNSIGNED NOT NULL;\n";
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
727 print "</pre></li>\n";
728 print "<li><p>You might have to by-pass the access check near the bottom of the file called update.php such that you can gain access to the updates: search for <i>user_access()</i>.</p></li>";
4a28077 - adding descriptions to modules (thanks Joe + Scott).
Kjartan Mannes authored
729 print "<li><p>";
730 print "Choose one of the links below to either upgrade from Drupal 3.x or update from a CVS checkout.<br />";
731 print "&raquo; upgrading will by default enable the standard Drupal themes and modules as well as setting some default values.<br />";
732 print "&raquo; updating will require modules and themes enabled manually under <i>Administer | Site configuration | modules</i>.<br />";
733 print "<p><b>&raquo; <a href=\"update.php?op=upgrade3\">Upgrade 3.x to 4.0.0</a></b></p>\n";
734 print "<p><b>&raquo; <a href=\"update.php?op=update\">Update CVS database</a></b></p>\n";
735 print "<p>Once you are done remove or disable access to update.php so nobody else can tamper with the database.</p>\n";
736 print "</p></li>";
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
737 print "<li><p>Go through the various administration pages to change the existing and new settings to your liking.</p></li>\n";
738 print "<li><p>Thanks for using Drupal!</p></li>\n";
739 print "</ol>";
497ab79 - added notes to update.php which you will see before you can perform…
Kjartan Mannes authored
740 print "</html>";
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
741 }
497ab79 - added notes to update.php which you will see before you can perform…
Kjartan Mannes authored
742
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
743 if ($op) {
744 include_once "includes/common.inc";
4a28077 - adding descriptions to modules (thanks Joe + Scott).
Kjartan Mannes authored
745 // Security check:
746 if (user_access(NULL) || variable_get("update_start", 0) == 0) {
c1f6ab3 - convert meta tags to taxonomy.
Kjartan Mannes authored
747 update_page();
748 }
749 else {
750 print message_access();
751 }
752 }
753 else {
754 update_info();
0a4f99e - added update.php to replace the updates/* files to make future upgr…
Kjartan Mannes authored
755 }
756 ?>
Something went wrong with that request. Please try again.