From 3335e3f881df67546db27bf2a3b78fd174ae1f59 Mon Sep 17 00:00:00 2001 From: ethem Date: Fri, 12 May 2006 18:36:30 +0000 Subject: [PATCH] Fix: Delete test transactions before update status as AN_STATUS_AUTHCAPTURE. Merged from MOODLE_16_STABLE. --- enrol/authorize/db/mysql.php | 6 ++++-- enrol/authorize/db/postgres7.php | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/enrol/authorize/db/mysql.php b/enrol/authorize/db/mysql.php index ef830d769c..06fba43906 100755 --- a/enrol/authorize/db/mysql.php +++ b/enrol/authorize/db/mysql.php @@ -29,11 +29,13 @@ function enrol_authorize_upgrade($oldversion=0) { table_column('enrol_authorize', '', 'timecreated', 'integer', '10', 'unsigned', '0', 'not null', 'status'); table_column('enrol_authorize', '', 'timeupdated', 'integer', '10', 'unsigned', '0', 'not null', 'timecreated'); // status index for speed. - execute_sql(" ALTER TABLE `{$CFG->prefix}enrol_authorize` ADD INDEX status(status) "); + execute_sql("ALTER TABLE `{$CFG->prefix}enrol_authorize` ADD INDEX status(status)"); + // Delete test transactions before update status as AN_STATUS_AUTHCAPTURE. + execute_sql("DELETE FROM `{$CFG->prefix}enrol_authorize` WHERE transid='0'", false); // defaults. $timenow = time(); $status = AN_STATUS_AUTH | AN_STATUS_CAPTURE; - execute_sql(" UPDATE {$CFG->prefix}enrol_authorize SET timecreated='$timenow', timeupdated='$timenow', status='$status' ", false); + execute_sql("UPDATE {$CFG->prefix}enrol_authorize SET timecreated='$timenow', timeupdated='$timenow', status='$status'", false); } if ($oldversion < 2005121200) { diff --git a/enrol/authorize/db/postgres7.php b/enrol/authorize/db/postgres7.php index a5d460bdf6..b32d9d7f12 100644 --- a/enrol/authorize/db/postgres7.php +++ b/enrol/authorize/db/postgres7.php @@ -41,6 +41,8 @@ function enrol_authorize_upgrade($oldversion=0) { table_column('enrol_authorize', '', 'timeupdated', 'integer', '10', 'unsigned', '0', 'not null', 'timecreated'); // status index for speed. modify_database('',"CREATE INDEX prefix_enrol_authorize_status_idx ON prefix_enrol_authorize (status);"); + // Delete test transactions before update status as AN_STATUS_AUTHCAPTURE. + execute_sql("DELETE FROM {$CFG->prefix}enrol_authorize WHERE transid='0'", false); // defaults. $timenow = time(); $status = AN_STATUS_AUTH | AN_STATUS_CAPTURE; -- 2.39.5