You are here

function recipe_field_schema in Recipe 7.2

Implements hook_field_schema().

File

./recipe.install, line 116
Install, update and uninstall functions for the recipe module.

Code

function recipe_field_schema($field) {
  return array(
    'columns' => array(
      'iid' => array(
        'description' => 'The {recipe_ingredient}.id referenced by field.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
      'quantity' => array(
        'type' => 'float',
        'not null' => FALSE,
      ),
      'unit_key' => array(
        'description' => 'Untranslated unit key from the units array.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'note' => array(
        'description' => 'Ingredient processing or notes related to recipe.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'indexes' => array(
      'iid' => array(
        'iid',
      ),
    ),
    'foreign keys' => array(
      'iid' => array(
        'table' => 'recipe_ingredient',
        'columns' => array(
          'iid' => 'id',
        ),
      ),
    ),
  );
}