Commit e2d3986d authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add primary key to artefact_file_files, artefact_file_image


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent e86cbb34
......@@ -13,6 +13,7 @@
<FIELD NAME="filetype" TYPE="text" NOTNULL="false" />
</FIELDS>
<KEYS>
<KEY NAME="artefactpk" TYPE="primary" FIELDS="artefact" />
<KEY NAME="artefactfk" TYPE="foreign" FIELDS="artefact" REFTABLE="artefact" REFFIELDS="id" />
</KEYS>
</TABLE>
......@@ -23,6 +24,7 @@
<FIELD NAME="height" TYPE="int" LENGTH="10" NOTNULL="false" />
</FIELDS>
<KEYS>
<KEY NAME="artefactpk" TYPE="primary" FIELDS="artefact" />
<KEY NAME="artefactfk" TYPE="foreign" FIELDS="artefact" REFTABLE="artefact" REFFIELDS="id" />
</KEYS>
</TABLE>
......
......@@ -227,6 +227,18 @@ function xmldb_artefact_file_upgrade($oldversion=0) {
execute_sql("DELETE FROM {artefact_file_files} WHERE artefact IN (SELECT id FROM {artefact} WHERE artefacttype = 'folder')");
}
if ($oldversion < 2009091701) {
$table = new XMLDBTable('artefact_file_files');
$key = new XMLDBKey('artefactpk');
$key->setAttributes(XMLDB_KEY_PRIMARY, array('artefact'));
add_key($table, $key);
$table = new XMLDBTable('artefact_file_image');
$key = new XMLDBKey('artefactpk');
$key->setAttributes(XMLDB_KEY_PRIMARY, array('artefact'));
add_key($table, $key);
}
return $status;
}
......
......@@ -28,7 +28,7 @@
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2009091700;
$config->version = 2009091701;
$config->release = '1.1.0';
?>
Supports Markdown
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