You are here

function vcardfield_field_schema in VCard Field 7

Implementation of hook_field_schema().

2 calls to vcardfield_field_schema()
vcardfield_update_7002 in ./vcardfield.install
Implements hook_update_N(). Add photo field to table
vcardfield_update_7003 in ./vcardfield.install
Implements hook_update_N(). Add middle name field

File

./vcardfield.install, line 7

Code

function vcardfield_field_schema($field) {
  if ($field['type'] == 'vcardfield') {
    $schema['columns']['prefix'] = array(
      'type' => 'varchar',
      'length' => '10',
      'not null' => FALSE,
    );
    $schema['columns']['first_name'] = array(
      'type' => 'varchar',
      'length' => '100',
      'not null' => FALSE,
    );
    $schema['columns']['middle_name'] = array(
      'type' => 'varchar',
      'length' => '100',
      'not null' => FALSE,
    );
    $schema['columns']['last_name'] = array(
      'type' => 'varchar',
      'length' => '100',
      'not null' => FALSE,
    );
    $schema['columns']['suffix'] = array(
      'type' => 'varchar',
      'length' => '25',
      'not null' => FALSE,
    );
    $schema['columns']['full_name'] = array(
      'type' => 'varchar',
      'length' => '255',
      'not null' => FALSE,
    );
    $schema['columns']['photo'] = array(
      'type' => 'varchar',
      'length' => '255',
      'not null' => FALSE,
    );
    $schema['columns']['title'] = array(
      'type' => 'varchar',
      'length' => '100',
      'not null' => FALSE,
    );
    $schema['columns']['organization'] = array(
      'type' => 'varchar',
      'length' => '100',
      'not null' => FALSE,
    );
    $schema['columns']['address_type'] = array(
      'type' => 'varchar',
      'length' => '4',
      'not null' => FALSE,
    );
    $schema['columns']['address'] = array(
      'type' => 'varchar',
      'length' => '255',
      'not null' => FALSE,
    );
    $schema['columns']['city'] = array(
      'type' => 'varchar',
      'length' => '100',
      'not null' => FALSE,
    );
    $schema['columns']['region'] = array(
      'type' => 'varchar',
      'length' => '100',
      'not null' => FALSE,
    );
    $schema['columns']['postalcode'] = array(
      'type' => 'varchar',
      'length' => '15',
      'not null' => FALSE,
    );
    $schema['columns']['country'] = array(
      'type' => 'varchar',
      'length' => '100',
      'not null' => FALSE,
    );
    $schema['columns']['phone_default'] = array(
      'type' => 'varchar',
      'length' => '25',
      'not null' => FALSE,
    );
    $schema['columns']['phone_cell'] = array(
      'type' => 'varchar',
      'length' => '25',
      'not null' => FALSE,
    );
    $schema['columns']['phone_fax'] = array(
      'type' => 'varchar',
      'length' => '25',
      'not null' => FALSE,
    );
    $schema['columns']['phone_home'] = array(
      'type' => 'varchar',
      'length' => '25',
      'not null' => FALSE,
    );
    $schema['columns']['email'] = array(
      'type' => 'varchar',
      'length' => '255',
      'not null' => FALSE,
    );
    $schema['columns']['link'] = array(
      'type' => 'varchar',
      'length' => '255',
      'not null' => FALSE,
    );
    $schema['columns']['label'] = array(
      'type' => 'varchar',
      'length' => '255',
      'not null' => FALSE,
    );
    $schema['columns']['instance'] = array(
      'type' => 'varchar',
      'length' => '255',
      'not null' => FALSE,
    );
    $schema['indexes'] = array(
      'name' => array(
        'last_name',
        'first_name',
      ),
      'link' => array(
        'link',
      ),
    );
    return $schema;
  }
}