From dbcda92b76b5e75b5d657a39a3ba8abc9828490a Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 25 Jan 2005 20:38:03 +0000 Subject: - Patch #16021 by tangent: changed the format "/blog/feed/52" to "/blog/52/feed". --- database/updates.inc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'database') 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); -- cgit v1.2.3