Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Create transid indexes for backup & restore speed.

  • Loading branch information...
commit 5f7a36628f8e977e9da503bbbf9807cd368955fa 1 parent e503f30
ethem authored
View
5 enrol/authorize/db/mysql.php
@@ -103,6 +103,11 @@ function enrol_authorize_upgrade($oldversion=0) {
table_column('enrol_authorize', 'transid', 'transid', 'integer', '10', 'unsigned', '0', 'not null');
}
+ if ($oldversion < 2006050400) { // Create transid indexes for backup & restore speed.
+ execute_sql("ALTER TABLE `{$CFG->prefix}enrol_authorize` ADD INDEX transid(transid)", false);
+ execute_sql("ALTER TABLE `{$CFG->prefix}enrol_authorize_refunds` ADD INDEX transid(transid)", false);
+ }
+
return $result;
}
View
6 enrol/authorize/db/mysql.sql
@@ -13,7 +13,8 @@ CREATE TABLE `prefix_enrol_authorize` (
PRIMARY KEY (`id`),
KEY `courseid` (`courseid`),
KEY `userid` (`userid`),
- KEY `status` (`status`)
+ KEY `status` (`status`),
+ KEY `transid` (`transid`)
) TYPE=MyISAM COMMENT='Holds all known information about authorize.net transactions';
CREATE TABLE `prefix_enrol_authorize_refunds` (
@@ -24,5 +25,6 @@ CREATE TABLE `prefix_enrol_authorize_refunds` (
`transid` int(10) unsigned default '0',
`settletime` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
- KEY `orderid` (`orderid`)
+ KEY `orderid` (`orderid`),
+ KEY `transid` (`transid`)
) TYPE=MyISAM COMMENT='Authorize.net refunds';
View
5 enrol/authorize/db/postgres7.php
@@ -114,6 +114,11 @@ function enrol_authorize_upgrade($oldversion=0) {
table_column('enrol_authorize', 'transid', 'transid', 'integer', '10', 'unsigned', '0', 'not null');
}
+ if ($oldversion < 2006050400) { // Create transid indexes for backup & restore speed.
+ execute_sql("CREATE INDEX {$CFG->prefix}enrol_authorize_transid_idx ON {$CFG->prefix}enrol_authorize(transid);", false);
+ execute_sql("CREATE INDEX {$CFG->prefix}enrol_authorize_refunds_transid_idx ON {$CFG->prefix}enrol_authorize_refunds(transid);", false);
+ }
+
return $result;
}
View
2  enrol/authorize/db/postgres7.sql
@@ -15,6 +15,7 @@ CREATE TABLE prefix_enrol_authorize (
CREATE INDEX prefix_enrol_authorize_courseid_idx ON prefix_enrol_authorize(courseid);
CREATE INDEX prefix_enrol_authorize_userid_idx ON prefix_enrol_authorize(userid);
CREATE INDEX prefix_enrol_authorize_status_idx ON prefix_enrol_authorize(status);
+CREATE INDEX prefix_enrol_authorize_transid_idx ON prefix_enrol_authorize(transid);
CREATE TABLE prefix_enrol_authorize_refunds (
id SERIAL PRIMARY KEY,
@@ -26,3 +27,4 @@ CREATE TABLE prefix_enrol_authorize_refunds (
);
CREATE INDEX prefix_enrol_authorize_refunds_orderid_idx ON prefix_enrol_authorize_refunds(orderid);
+CREATE INDEX prefix_enrol_authorize_refunds_transid_idx ON prefix_enrol_authorize_refunds(transid);
View
2  enrol/authorize/version.php
@@ -1,6 +1,6 @@
<?PHP // $Id$
-$plugin->version = 2006021500;
+$plugin->version = 2006050400;
$plugin->requires = 2005072200;
?>
Please sign in to comment.
Something went wrong with that request. Please try again.