Skip to content

Commit

Permalink
Fix: Delete test transactions before update status as AN_STATUS_AUTHC…
Browse files Browse the repository at this point in the history
…APTURE.
  • Loading branch information
ethem committed May 12, 2006
1 parent 55c0d5b commit be1ed90
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions enrol/authorize/db/mysql.php
Expand Up @@ -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', '', 'timecreated', 'integer', '10', 'unsigned', '0', 'not null', 'status');
table_column('enrol_authorize', '', 'timeupdated', 'integer', '10', 'unsigned', '0', 'not null', 'timecreated'); table_column('enrol_authorize', '', 'timeupdated', 'integer', '10', 'unsigned', '0', 'not null', 'timecreated');
// status index for speed. // 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. // defaults.
$timenow = time(); $timenow = time();
$status = AN_STATUS_AUTH | AN_STATUS_CAPTURE; $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) { if ($oldversion < 2005121200) {
Expand Down
2 changes: 2 additions & 0 deletions enrol/authorize/db/postgres7.php
Expand Up @@ -41,6 +41,8 @@ function enrol_authorize_upgrade($oldversion=0) {
table_column('enrol_authorize', '', 'timeupdated', 'integer', '10', 'unsigned', '0', 'not null', 'timecreated'); table_column('enrol_authorize', '', 'timeupdated', 'integer', '10', 'unsigned', '0', 'not null', 'timecreated');
// status index for speed. // status index for speed.
modify_database('',"CREATE INDEX prefix_enrol_authorize_status_idx ON prefix_enrol_authorize (status);"); 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. // defaults.
$timenow = time(); $timenow = time();
$status = AN_STATUS_AUTH | AN_STATUS_CAPTURE; $status = AN_STATUS_AUTH | AN_STATUS_CAPTURE;
Expand Down

0 comments on commit be1ed90

Please sign in to comment.