diff options
Diffstat (limited to 'database/updates.inc')
-rw-r--r-- | database/updates.inc | 21 |
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); |