Commit 304db881 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add logo column to institution table

Bug #805780

If set, the value refers to an artefact id of an image owned by the

Change-Id: I30ce39b400f12f77579c984090010b2ddd5d29d0
Signed-off-by: default avatarRichard Mansfield <>
parent 5608ac39
......@@ -50,6 +50,11 @@
<FIELD NAME="showonlineusers" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="2"/>
<FIELD NAME="allowinstitutionpublicviews" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
<FIELD NAME="registerconfirm" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1"/>
<!-- This field should be foreign keyed to the artefact table, however the
artefact table already has a key to this table, and XMLDB isn't smart enough
to create the tables first, then the keys. The foreign key will be created
during the postinst phase. -->
<FIELD NAME="logo" TYPE="int" LENGTH="10" NOTNULL="false"/>
<KEY NAME="primary" TYPE="primary" FIELDS="name" />
......@@ -2483,5 +2483,17 @@ function xmldb_core_upgrade($oldversion=0) {
add_key($table, $key);
if ($oldversion < 2011070501) {
// Add logo to institution table
$table = new XMLDBTable('institution');
$field = new XMLDBField('logo');
$field->setAttributes(XMLDB_TYPE_INTEGER, '10');
add_field($table, $field);
$key = new XMLDBKey('logofk');
$key->setAttributes(XMLDB_KEY_FOREIGN, array('logo'), 'artefact', array('id'));
add_key($table, $key);
return $status;
......@@ -589,6 +589,11 @@ function core_postinst() {
$key->setAttributes(XMLDB_KEY_FOREIGN, array('profileicon'), 'artefact', array('id'));
add_key($table, $key);
$table = new XMLDBTable('institution');
$key = new XMLDBKey('logofk');
$key->setAttributes(XMLDB_KEY_FOREIGN, array('logo'), 'artefact', array('id'));
add_key($table, $key);
// PostgreSQL supports indexes over functions of columns, MySQL does not.
// We make use if this if we can
if (is_postgres()) {
......@@ -28,7 +28,7 @@
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2011070500;
$config->version = 2011070501;
$config->release = '1.5.0dev';
$config->minupgradefrom = 2008040200;
$config->minupgraderelease = '1.0.0 (release tag 1.0.0_RELEASE)';
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