function content_lock_update_7200 in Content locking (anti-concurrent editing) 7.3
Add entity ID and type support.
File
- ./
content_lock.install, line 116 - Install file.
Code
function content_lock_update_7200() {
if (!db_field_exists('content_lock', 'entity_type')) {
$fields['entity_type'] = array(
'description' => 'The type of an entity.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => 'node',
);
db_add_field('content_lock', 'entity_type', $fields['entity_type']);
}
if (db_field_exists('content_lock', 'nid')) {
$fields['entity_id'] = array(
'description' => 'The primary identifier for an entity.',
'type' => 'int',
'size' => 'normal',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
);
db_change_field('content_lock', 'nid', 'entity_id', $fields['entity_id']);
}
// Update primary keys.
db_drop_primary_key('content_lock');
db_add_primary_key('content_lock', array(
'entity_id',
'entity_type',
));
}