Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

PostgreSQL support for enrol::authorize.

  • Loading branch information...
commit c0733012cfa29d460ee1940985741454972fae6e 1 parent c87139d
ethem authored
View
29 enrol/authorize/db/postgres7.php
@@ -0,0 +1,29 @@
+<?PHP //$Id$
+
+// PostgreSQL commands for upgrading this enrolment module
+
+function authorize_upgrade($oldversion=0) {
+
+ global $CFG, $THEME, $db;
+
+ $result = true;
+
+ if ($oldversion == 0) {
+ modify_database("$CFG->dirroot/enrol/authorize/db/postgres7.sql");
+ }
+
+ if ($oldversion < 2005080200) {
+ // Be sure, only last 4 digit is inserted.
+ table_column('enrol_authorize', 'cclastfour', 'cclastfour', 'integer', '4', 'unsigned', '0', 'not null');
+ table_column('enrol_authorize', 'courseid', 'courseid', 'integer', '10', 'unsigned', '0', 'not null');
+ table_column('enrol_authorize', 'userid ', 'userid ', 'integer', '10', 'unsigned', '0', 'not null');
+ // Add some indexes for speed.
+ modify_database('',"CREATE INDEX prefix_enrol_authorize_courseid_idx ON prefix_enrol_authorize (courseid);");
+ modify_database('',"CREATE INDEX prefix_enrol_authorize_userid_idx ON prefix_enrol_authorize (userid);");
+ }
+
+ return $result;
+
+}
+
+?>
View
11 enrol/authorize/db/postgres7.sql
@@ -0,0 +1,11 @@
+CREATE TABLE prefix_enrol_authorize (
+ id SERIAL PRIMARY KEY,
+ cclastfour integer default '0',
+ ccexp varchar(6) default '',
+ cvv varchar(4) default '',
+ ccname varchar(255) default '',
+ courseid integer NOT NULL default '0',
+ userid integer NOT NULL default '0',
+ avscode varchar(1) default 'P',
+ transid varchar(255) default '',
+);
View
2  enrol/authorize/version.php
@@ -1,6 +1,6 @@
<?PHP // $Id$
-$module->version = 2005072500;
+$module->version = 2005080200;
$module->requires = 2005072200;
?>
Please sign in to comment.
Something went wrong with that request. Please try again.