summaryrefslogtreecommitdiff
path: root/database
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-01-25 20:38:03 +0000
committerDries Buytaert <dries@buytaert.net>2005-01-25 20:38:03 +0000
commitdbcda92b76b5e75b5d657a39a3ba8abc9828490a (patch)
tree19afd90594f7d4239843824fe56a491143f8545a /database
parent01b8e7fdf05cf44ac9d76bbefd3b9c1bb1d473f7 (diff)
downloadbrdo-dbcda92b76b5e75b5d657a39a3ba8abc9828490a.tar.gz
brdo-dbcda92b76b5e75b5d657a39a3ba8abc9828490a.tar.bz2
- Patch #16021 by tangent: changed the format "/blog/feed/52" to "/blog/52/feed".
Diffstat (limited to 'database')
-rw-r--r--database/updates.inc21
1 files changed, 20 insertions, 1 deletions
diff --git a/database/updates.inc b/database/updates.inc
index f41f1d2e1..6ebe84774 100644
--- a/database/updates.inc
+++ b/database/updates.inc
@@ -95,7 +95,8 @@ $sql_updates = array(
"2005-01-14" => "update_116",
"2005-01-18" => "update_117",
"2005-01-19" => "update_118",
- "2005-01-20" => "update_119"
+ "2005-01-20" => "update_119",
+ "2005-01-25" => "update_120"
);
function update_32() {
@@ -2142,6 +2143,24 @@ function update_119() {
return $ret;
}
+function update_120() {
+ // Add column to the blocks table.
+ $ret = array();
+ $ret[] = update_sql("ALTER TABLE {blocks} ADD types varchar(16)");
+
+ // Rewrite old URL aliases. Works for both PostgreSQL and MySQL
+ $result = db_query("SELECT pid, src FROM {url_alias} WHERE src LIKE 'blog/%%'");
+ while ($alias = db_fetch_object($result)) {
+ list(, $page, $op, $uid) = explode('/', $alias->src);
+ if ($page == 'feed') {
+ $new = "blog/$uid/feed";
+ update_sql("UPDATE {url_alias} SET src = '%s' WHERE pid = '%s'", $new, $alias->pid);
+ }
+ }
+
+ return $ret;
+}
+
function update_sql($sql) {
$edit = $_POST["edit"];
$result = db_query($sql);