View source
<?php
function merci_hours_schema() {
$schema = array();
$schema['merci_hours'] = array(
'description' => 'Stores merci hours.',
'fields' => array(
'id' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Primary Key: Unique work calendar ID.',
),
'name' => array(
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => '',
'description' => 'The machine name of this work calendar.',
),
'label' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => 'The label of this work calendar.',
),
'description' => array(
'type' => 'text',
'not null' => FALSE,
'size' => 'medium',
'description' => 'A brief description of this work calendar.',
),
) + entity_exportable_schema_fields(),
'primary key' => array(
'id',
),
'unique keys' => array(
'name' => array(
'name',
),
),
);
return $schema;
}
function merci_hours_uninstall() {
variable_del('merci_hours_default');
merci_core_delete_instances('merci_hours');
}
function merci_hours_enable() {
$fields = merci_hours_merci_fields_info();
merci_core_create_field($fields[MERCI_HOURS_FIELD], 'merci_hours', 'merci_hours');
}