Commit a8d56b68 authored by Donal McMullan's avatar Donal McMullan

Database and upgrade stuff

parent 3201f1bd
......@@ -27,9 +27,9 @@
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2007050100;
$config->version = 2007062900;
$config->release = '0.1';
$config->requires_config = 1;
$config->requires_parent = 0;
?>
\ No newline at end of file
?>
......@@ -27,7 +27,7 @@
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2006101800;
$config->version = 2007062900;
$config->release = '0.1';
$config->requires_config = 0;
$config->requires_parent = 0;
......
......@@ -27,7 +27,7 @@
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2007041000;
$config->version = 2007062900;
$config->release = '0.1';
$config->requires_config = 1;
$config->requires_parent = 1;
......
......@@ -52,22 +52,6 @@
<KEY NAME="primary" TYPE="primary" FIELDS="name" />
</KEYS>
</TABLE>
<TABLE NAME="sso_session">
<FIELDS>
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" />
<FIELD NAME="instanceid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" />
<FIELD NAME="username" TYPE="char" LENGTH="30" NOTNULL="true"/>
<FIELD NAME="useragent" TYPE="char" LENGTH="40" NOTNULL="true"/>
<FIELD NAME="token" TYPE="char" LENGTH="40" NOTNULL="true"/>
<FIELD NAME="confirmtimeout" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" />
<FIELD NAME="expires" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" />
<FIELD NAME="sessionid" TYPE="char" LENGTH="40" NOTNULL="true"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="userid" />
<KEY NAME="userfk" TYPE="foreign" FIELDS="userid,username" REFTABLE="usr" REFFIELDS="userid,username" />
</KEYS>
</TABLE>
<TABLE NAME="auth_instance">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
......@@ -139,6 +123,22 @@
<INDEX NAME="usernameuk" UNIQUE="true" FIELDS="username,authinstance"/>
</INDEXES>
</TABLE>
<TABLE NAME="sso_session">
<FIELDS>
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" />
<FIELD NAME="instanceid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" />
<FIELD NAME="username" TYPE="char" LENGTH="30" NOTNULL="true"/>
<FIELD NAME="useragent" TYPE="char" LENGTH="40" NOTNULL="true"/>
<FIELD NAME="token" TYPE="char" LENGTH="40" NOTNULL="true"/>
<FIELD NAME="confirmtimeout" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" />
<FIELD NAME="expires" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" />
<FIELD NAME="sessionid" TYPE="char" LENGTH="40" NOTNULL="true"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="userid" />
<!-- <KEY NAME="userfk" TYPE="foreign" FIELDS="userid,username" REFTABLE="usr" REFFIELDS="userid,username" /> -->
</KEYS>
</TABLE>
<TABLE NAME="event_type">
<FIELDS>
<FIELD NAME="name" TYPE="char" LENGTH="50" NOTNULL="true" />
......
......@@ -280,9 +280,9 @@ function xmldb_core_upgrade($oldversion=0) {
create_table($table);
$table = new XMLDBTable('auth_installed');
$field = new XMLDBField('name');
$field->setAttributes(XMLDB_TYPE_CHAR, 100, null, true, null, null, null);
change_field_precision($table, $field);
//$field = new XMLDBField('name');
//$field->setAttributes(XMLDB_TYPE_CHAR, 100, null, true, null, null, null);
//change_field_precision($table, $field);
$field = new XMLDBField('requires_config');
$field->setAttributes(XMLDB_TYPE_INTEGER, 1, XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, 0);
......@@ -362,9 +362,10 @@ function xmldb_core_upgrade($oldversion=0) {
$table->addKeyInfo('primary', XMLDB_KEY_PRIMARY, array('userid','instanceid'));
create_table($table);
$key = new XMLDBKey("userfk");
$key->setAttributes(XMLDB_KEY_FOREIGN, array('userid','username'), 'usr', array('id','username'));
add_key($table, $key);
//$table = new XMLDBTable('sso_session');
//$key = new XMLDBKey("userfk");
//$key->setAttributes(XMLDB_KEY_FOREIGN, array('userid','username'), 'usr', array('id','username'));
//add_key($table, $key);
$table = new XMLDBTable('usr');
$field = new XMLDBField('authinstance');
......@@ -389,6 +390,13 @@ function xmldb_core_upgrade($oldversion=0) {
$key = new XMLDBKey("lastauthinstancefk");
$key->setAttributes(XMLDB_KEY_FOREIGN, array('lastauthinstance'), 'auth_instance', array('id'));
add_key($table, $key);
$record = new stdClass();
$record->instancename='internal';
$record->priority='1';
$record->institution='mahara';
$record->authname='internal';
// insert_record('auth_instance',$record);
}
......
......@@ -27,7 +27,7 @@
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2007062000;
$config->version = 2007062900;
$config->release = '0.8.0.dev';
$config->minupgradefrom = 2007011600;
$config->minupgraderelease = '0.4.0 (build tag BUILD_20070122)';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment