You are here

function availability_calendar_field_schema in Availability Calendars 7.4

Same name and namespace in other branches
  1. 7.5 availability_calendar.install \availability_calendar_field_schema()
  2. 7.3 availability_calendar.install \availability_calendar_field_schema()

Implements hook_field_schema(). @link http://api.drupal.org/api/drupal/modules--field--field.api.php/function/...

File

./availability_calendar.install, line 240

Code

function availability_calendar_field_schema($field) {
  if ($field['type'] == 'availability_calendar') {
    return array(
      'columns' => array(
        'enabled' => array(
          'type' => 'int',
          'size' => 'tiny',
          'default' => 1,
          'not null' => TRUE,
        ),
        'name' => array(
          'type' => 'varchar',
          'length' => 255,
          'default' => '',
          'not null' => TRUE,
        ),
        'cid' => array(
          'type' => 'int',
          'not null' => TRUE,
        ),
      ),
      'indexes' => array(
        // Can be used to find out what fields refer to a given calendar.
        'cid' => array(
          'cid',
        ),
      ),
      'foreign keys' => array(
        'cid' => array(
          'table' => 'availability_calendar_calendar',
          'columns' => array(
            'cid' => 'cid',
          ),
        ),
      ),
    );
  }
  return array();
}