Commit 996f06f7 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1760970: Allow the artefact classes to commit in correct order



When the contenthash is missing

Also set the new orientation column as not null

behatnotneeded

Change-Id: I64de51a2a0f456ac54f7a47cbc6398fb1b588594
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 2171fcb8
......@@ -26,7 +26,7 @@
<FIELD NAME="artefact" TYPE="int" LENGTH="10" NOTNULL="true" />
<FIELD NAME="width" TYPE="int" LENGTH="10" NOTNULL="false" />
<FIELD NAME="height" TYPE="int" LENGTH="10" NOTNULL="false" />
<FIELD NAME="orientation" TYPE="int" LENGTH="10" NOTNULL="false" DEFAULT="'0'" ENUM="true" ENUMVALUES="'0','90','180','270'" />
<FIELD NAME="orientation" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="'0'" ENUM="true" ENUMVALUES="'0','90','180','270'" />
</FIELDS>
<KEYS>
<KEY NAME="artefactpk" TYPE="primary" FIELDS="artefact" />
......
......@@ -502,7 +502,7 @@ function xmldb_artefact_file_upgrade($oldversion=0) {
log_debug("Add 'orientation' column to the 'artefact_file_image' table for image rotator");
$table = new XMLDBTable('artefact_file_image');
$field = new XMLDBField('orientation');
$field->setAttributes(XMLDB_TYPE_CHAR, 10, null, null, null, XMLDB_ENUM, array('0', '90', '180', '270'), '0');
$field->setAttributes(XMLDB_TYPE_CHAR, 10, null, XMLDB_NOTNULL, null, XMLDB_ENUM, array('0', '90', '180', '270'), '0');
if (!field_exists($table, $field)) {
add_field($table, $field);
}
......
......@@ -1112,7 +1112,6 @@ class ArtefactTypeFile extends ArtefactTypeFileBase {
if (!empty($this->contenthash)) {
$this->dirty = true;
$this->commit();
}
}
......
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