From 1b63e57388839946172cb225273d4e4b49248f5b Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Tue, 5 Jun 2007 05:40:10 +0000 Subject: [PATCH] adding a usermodified field to post table --- lib/db/install.xml | 8 +++++--- lib/db/upgrade.php | 19 +++++++++++++++++++ version.php | 2 +- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/lib/db/install.xml b/lib/db/install.xml index 34ae950126..e946e85282 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -756,10 +756,12 @@ - + + - + + diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 57c9d10634..5a97b266ef 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -1324,6 +1324,25 @@ function xmldb_main_upgrade($oldversion=0) { // Launch add field deleted $result = $result && add_field($table, $field); } + + if ($result && $oldversion < 2007060500) { + + /// Define field usermodified to be added to post + $table = new XMLDBTable('post'); + $field = new XMLDBField('usermodified'); + $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null, null, null, 'created'); + + /// Launch add field usermodified + $result = $result && add_field($table, $field); + + /// Define key usermodified (foreign) to be added to post + $table = new XMLDBTable('post'); + $key = new XMLDBKey('usermodified'); + $key->setAttributes(XMLDB_KEY_FOREIGN, array('usermodified'), 'user', array('id')); + + /// Launch add key usermodified + $result = $result && add_key($table, $key); + } return $result; } diff --git a/version.php b/version.php index 12d276dd1e..0e88b375d4 100644 --- a/version.php +++ b/version.php @@ -6,7 +6,7 @@ // This is compared against the values stored in the database to determine // whether upgrades should be performed (see lib/db/*.php) - $version = 2007060100; // YYYYMMDD = date + $version = 2007060500; // YYYYMMDD = date // XY = increments within a single day $release = '1.9 dev'; // Human-friendly version name -- 2.39.5