function eck_update_7001 in Entity Construction Kit (ECK) 7
Same name and namespace in other branches
- 7.3 eck.install \eck_update_7001()
- 7.2 eck.install \eck_update_7001()
Update 7001
File
- ./
eck.install, line 212 - This install file creates a table for the this module to store information about entities. Well, the only information that it needs to store is a name and a label for each entity created, the rest of the information is generated by the functions.
Code
function eck_update_7001() {
// For importing and exporting things it is always good to have a uuid, so we
// will add that colunm to the current entity types.
// Now we add a type (bundle) to the table for each entity in the eck table.
$results = db_select('eck', 't')
->fields('t')
->execute();
foreach ($results as $record) {
// Also we want to add a field to all the enity tables for the type, and
// populated with the current type.
db_add_field("eck_{$record->name}", 'uuid', array(
'type' => 'char',
'length' => 36,
'not null' => TRUE,
'default' => '',
'description' => 'The Universally Unique Identifier.',
));
}
}