function workflow_update_7017 in Workflow 7.2
Add/correct a primary key to {workflow_scheduled_transition}.
File
- ./
workflow.install, line 795 - Install, update and uninstall functions for the workflow module.
Code
function workflow_update_7017() {
// Drop existing primary key.
db_drop_primary_key('workflow_scheduled_transition');
// Add new primary key.
$spec = array(
'type' => 'serial',
'not null' => TRUE,
);
$keys_new = array(
'primary key' => array(
'tid',
),
);
if (!db_field_exists('workflow_scheduled_transition', 'tid')) {
db_add_field('workflow_scheduled_transition', 'tid', $spec, $keys_new);
}
else {
db_change_field('workflow_scheduled_transition', 'tid', 'tid', $spec, $keys_new);
}
return t('Added tid primary key to {workflow_scheduled_transition}');
}