summaryrefslogtreecommitdiff
path: root/update.php
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-09-30 20:59:26 +0000
committerDries Buytaert <dries@buytaert.net>2003-09-30 20:59:26 +0000
commit6baa7d7c218549f898366b60cc4257c010efee71 (patch)
tree6bd02e1d6341bc08070ae66f1626f427ff95e52a /update.php
parentbcb5ebcdbea167801c7e29916b50b80916f9b0d2 (diff)
downloadbrdo-6baa7d7c218549f898366b60cc4257c010efee71.tar.gz
brdo-6baa7d7c218549f898366b60cc4257c010efee71.tar.bz2
- Some URL alias fixes by Matt.
Diffstat (limited to 'update.php')
-rw-r--r--update.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/update.php b/update.php
index 1a88cf5fd..d27375187 100644
--- a/update.php
+++ b/update.php
@@ -47,7 +47,8 @@ $mysql_updates = array(
"2003-08-27" => "update_62",
"2003-09-09" => "update_63",
"2003-09-10" => "update_64",
- "2003-09-29" => "update_65"
+ "2003-09-29" => "update_65",
+ "2003-09-30" => "update_66"
);
function update_32() {
@@ -457,6 +458,25 @@ function update_65() {
}
}
+function update_66() {
+ update_sql("CREATE TABLE path (
+ pid int(10) unsigned NOT NULL auto_increment,
+ old varchar(128) NOT NULL default '',
+ new varchar(128) NOT NULL default '',
+ PRIMARY KEY (pid),
+ UNIQUE KEY old (old),
+ UNIQUE KEY new (new)
+ )");
+
+ // Migrate the existing paths:
+ $result = db_query("SELECT nid, path FROM {node} WHERE path != ''");
+ while ($node = db_fetch_object($result)) {
+ update_sql("INSERT INTO {path} (old, new) VALUES ('node/view/$node->nid', '". check_query($node->path) ."')");
+ }
+
+ update_sql("ALTER TABLE {node} DROP path");
+ }
+
/*
** System functions
*/