You are here

function multifield_schema in Multifield 7

Same name and namespace in other branches
  1. 7.2 multifield.install \multifield_schema()

Implements hook_schema().

File

./multifield.install, line 6

Code

function multifield_schema() {
  $schema['multifield'] = array(
    'description' => '',
    'fields' => array(
      'mfid' => array(
        'description' => 'Primary ID field for the table. Not used for anything except internal lookups.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'no export' => TRUE,
      ),
      'machine_name' => array(
        'type' => 'varchar',
        'length' => 128,
        'default' => '',
        'not null' => TRUE,
      ),
      'label' => array(
        'type' => 'varchar',
        'length' => 255,
        'default' => '',
        'not null' => TRUE,
      ),
      'description' => array(
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'big',
        'description' => 'Description of the multifield.',
      ),
    ),
    'primary key' => array(
      'mfid',
    ),
    'unique keys' => array(
      'machine_name' => array(
        'machine_name',
      ),
    ),
    'export' => array(
      'key' => 'machine_name',
      'key name' => 'Machine name',
      'primary key' => 'mfid',
      'identifier' => 'multifield',
      'default hook' => 'multifield_default_multifield',
      'cache defaults' => TRUE,
      'load callback' => 'multifield_load',
      'load all callback' => 'multifield_load_all',
      'save callback' => 'multifield_save',
      'delete callback' => 'multifield_delete',
    ),
  );
  return $schema;
}