Permalink
Browse files

SQL file contains all upgrades.

  • Loading branch information...
1 parent 594d381 commit 08cdce7e5ef6e1000cf0fea01b206168efa6a35f ethem committed Apr 26, 2006
Showing with 11 additions and 6 deletions.
  1. +4 −2 enrol/authorize/db/postgres7.php
  2. +7 −4 enrol/authorize/db/postgres7.sql
@@ -8,9 +8,11 @@ function authorize_upgrade($oldversion=0) {
$result = true;
if ($oldversion == 0) {
- modify_database("$CFG->dirroot/enrol/authorize/db/postgres7.sql");
+ $result = modify_database("$CFG->dirroot/enrol/authorize/db/postgres7.sql");
+ return $result; // SQL file contains all upgrades.
} else if (!in_array($CFG->prefix . 'enrol_authorize', $db->MetaTables('TABLES'))) {
- modify_database("$CFG->dirroot/enrol/authorize/db/postgres7.sql");
+ $result = modify_database("$CFG->dirroot/enrol/authorize/db/postgres7.sql");
+ return $result; // SQL file contains all upgrades.
}
if ($oldversion < 2005071601) {
@@ -1,11 +1,14 @@
CREATE TABLE prefix_enrol_authorize (
id SERIAL PRIMARY KEY,
- cclastfour integer default '0',
+ cclastfour integer DEFAULT 0 NOT NULL,
ccexp varchar(6) default '',
cvv varchar(4) default '',
ccname varchar(255) default '',
- courseid integer NOT NULL default '0',
- userid integer NOT NULL default '0',
+ courseid integer DEFAULT 0 NOT NULL,
+ userid integer DEFAULT 0 NOT NULL,
avscode varchar(1) default 'P',
transid varchar(255) default ''
-);
+);
+
+CREATE INDEX prefix_enrol_authorize_courseid_idx ON prefix_enrol_authorize(courseid);
+CREATE INDEX prefix_enrol_authorize_userid_idx ON prefix_enrol_authorize(userid);

0 comments on commit 08cdce7

Please sign in to comment.