Skip to content

Commit

Permalink
ISLANDORA-2342 (#260)
Browse files Browse the repository at this point in the history
Fix issue with previous update hook where we set a column to not null
that may contain null values. Instead of making this column not null
we just allow this column to contains nulls.

This commit does three things:
  - Updates the schemea to allow nulls in the transforms collumn
  - Fixes the bug in the update hook, so users shouldn't see the issue
  - Adds a new update hook to make sure the column is the same for
    everyone.
  • Loading branch information
jonathangreen authored and DiegoPino committed Nov 20, 2018
1 parent 31adbbf commit baf9332
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions builder/xml_form_builder.install
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function xml_form_builder_schema() {
'description' => 'An XSL transform for setting the Fedora object\'s Dublin Core metadata datastream.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'not null' => FALSE,
),
'self_transform' => array(
'description' => 'A xsl transform for setting the Fedora Object\'s Dublin Core metadata datastream.',
Expand Down Expand Up @@ -522,14 +522,6 @@ function xml_form_builder_update_7106() {
'not null' => TRUE,
)
);
db_change_field('xml_form_builder_form_associations', 'transform', 'transform',
array(
'description' => 'An XSL transform for setting the Fedora object\'s Dublin Core metadata datastream.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
)
);
db_change_field('xml_form_builder_form_associations', 'template', 'template',
array(
'description' => 'A sample metadata file used to prepopulate the form on ingest.',
Expand Down Expand Up @@ -620,3 +612,19 @@ function xml_form_builder_update_7106() {
db_add_primary_key('xml_form_builder_xslts', array('xslt_id'));
}
}

/**
* Allow null in tranform field.
*
* Previous update was causing issues when the transform was allowed to be null.
*/
function xml_form_builder_update_7107() {
db_change_field('xml_form_builder_form_associations', 'transform', 'transform',
array(
'description' => 'An XSL transform for setting the Fedora object\'s Dublin Core metadata datastream.',
'type' => 'varchar',
'length' => 128,
'not null' => FALSE,
)
);
}

0 comments on commit baf9332

Please sign in to comment.