From 156df4ed3f258a38f63fc7c7bbc4118e15862563 Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 27 Feb 2008 04:38:39 +0000 Subject: [PATCH] Merged MDL-90 partial patch for the new webdav_locks table from Martin Langhoff --- lib/db/install.xml | 22 ++++++++++++++++++++++ lib/db/upgrade.php | 33 +++++++++++++++++++++++++++++++++ version.php | 8 ++++---- 3 files changed, 59 insertions(+), 4 deletions(-) diff --git a/lib/db/install.xml b/lib/db/install.xml index 35c6a378dc..6192d12460 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1652,6 +1652,28 @@ + + + + + + + + + + + + + + + + + + + + + +
diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index b921c92f02..f97ef022c7 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2889,6 +2889,39 @@ function xmldb_main_upgrade($oldversion=0) { upgrade_main_savepoint($result, 2007101508.06); } + if ($result && $oldversion < 2007101508.07) { + + /// Define table webdav_locks to be created + $table = new XMLDBTable('webdav_locks'); + + /// Adding fields to table webdav_locks + $table->addFieldInfo('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null, null, null); + $table->addFieldInfo('token', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, null, null); + $table->addFieldInfo('path', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, null, null); + $table->addFieldInfo('expiry', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0'); + $table->addFieldInfo('userid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0'); + $table->addFieldInfo('recursive', XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0'); + $table->addFieldInfo('exclusivelock', XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0'); + $table->addFieldInfo('created', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0'); + $table->addFieldInfo('modified', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0'); + $table->addFieldInfo('owner', XMLDB_TYPE_CHAR, '255', null, null, null, null, null, null); + + /// Adding keys to table webdav_locks + $table->addKeyInfo('primary', XMLDB_KEY_PRIMARY, array('id')); + $table->addKeyInfo('token', XMLDB_KEY_UNIQUE, array('token')); + + /// Adding indexes to table webdav_locks + $table->addIndexInfo('path', XMLDB_INDEX_NOTUNIQUE, array('path')); + $table->addIndexInfo('expiry', XMLDB_INDEX_NOTUNIQUE, array('expiry')); + + /// Launch create table for webdav_locks + $result = $result && create_table($table); + + /// Main savepoint reached + upgrade_main_savepoint($result, 2007101508.07); + } + + return $result; } diff --git a/version.php b/version.php index 76a5d4bacd..a50787ef11 100644 --- a/version.php +++ b/version.php @@ -6,10 +6,10 @@ // This is compared against the values stored in the database to determine // whether upgrades should be performed (see lib/db/*.php) - $version = 2007101508.06; // YYYYMMDD = date of the 1.9 branch (don't change) - // X = release number 1.9.[0,1,2,3...] - // Y = micro-increments between releases + $version = 2007101508.07; // YYYYMMDD = date of the 1.9 branch (don't change) + // X = release number 1.9.[0,1,2,3...] + // Y.YY = micro-increments between releases - $release = '2.0 dev'; // Human-friendly version name + $release = '2.0 dev'; // Human-friendly version name ?> -- 2.39.5