function panelizer_update_7102 in Panelizer 7.2
Same name and namespace in other branches
- 7.3 panelizer.install \panelizer_update_7102()
Add revision support.
File
- ./
panelizer.install, line 281 - Install, update and uninstall functions for the panelizer module.
Code
function panelizer_update_7102() {
// Remove the primary key.
db_drop_primary_key('panelizer_entity');
// Add the entity type.
$revision_id = array(
'description' => 'The revision id of the entity.',
'type' => 'int',
'unsigned' => TRUE,
);
db_add_field('panelizer_entity', 'revision_id', $revision_id);
db_query("UPDATE {panelizer_entity} pe LEFT JOIN {node} n ON pe.entity_id = n.nid SET pe.revision_id = n.vid");
// Add the new index
db_add_primary_key('panelizer_entity', array(
'entity_type',
'entity_id',
'revision_id',
));
return t('Added revision support.');
}