function botcha_schema in BOTCHA Spam Prevention 7.2
Same name and namespace in other branches
- 6 botcha.install \botcha_schema()
- 6.2 botcha.install \botcha_schema()
- 6.3 botcha.install \botcha_schema()
- 7 botcha.install \botcha_schema()
- 7.3 botcha.install \botcha_schema()
Implements hook_schema().
1 call to botcha_schema()
- botcha_update_7200 in ./
botcha.install - Create flexible relationships between recipe books and recipes and between recipe books and forms.
File
- ./
botcha.install, line 13
Code
function botcha_schema() {
$schema['botcha_form'] = array(
'description' => 'Contains a list of all forms for BOTCHA spam protection.',
'fields' => array(
'id' => array(
'description' => 'The machine name of the form.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
),
),
'primary key' => array(
'id',
),
);
$schema['botcha_recipe'] = array(
'description' => 'Contains a list of all recipes for BOTCHA spam protection.',
'fields' => array(
'id' => array(
'description' => 'The machine name of the recipe.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
),
'title' => array(
'description' => 'The title of the concrete recipe.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
),
'description' => array(
'description' => 'The description of the concrete recipe.',
'type' => 'text',
'size' => 'big',
'not null' => FALSE,
),
'classname' => array(
'description' => 'The name of the class initialized for the concrete recipe.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
),
),
'primary key' => array(
'id',
),
);
$schema['botcha_recipebook'] = array(
'description' => 'Contains a list of all recipe books for BOTCHA spam protection.',
'fields' => array(
'id' => array(
'description' => 'The machine name of the recipe book.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
),
'title' => array(
'description' => 'The title of the concrete recipe book.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
),
'description' => array(
'description' => 'The description of the concrete recipe book.',
'type' => 'text',
'size' => 'big',
'not null' => FALSE,
),
),
'primary key' => array(
'id',
),
);
$schema['botcha_recipebook_form'] = array(
'description' => 'Contains a list of the relationships between recipe books and forms.',
'fields' => array(
'rbid' => array(
'description' => 'The machine name of the recipe book.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
),
'form_id' => array(
'description' => 'The string identificator of the form.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
),
),
'primary key' => array(
'form_id',
),
'indexes' => array(
'brf_rbid' => array(
'rbid',
),
),
'foreign keys' => array(
'brf_recipebook' => array(
'table' => 'botcha_recipebook',
'columns' => array(
'rbid' => 'id',
),
),
),
);
$schema['botcha_recipebook_recipe'] = array(
'description' => 'Contains a list of the relationships between recipe books and recipes.',
'fields' => array(
'rbid' => array(
'description' => 'The machine name of the recipe book.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
),
'recipe_id' => array(
'description' => 'The machine name of the recipe.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
),
),
'primary key' => array(
'rbid',
'recipe_id',
),
'indexes' => array(
'brr_rbid' => array(
'rbid',
),
'brr_recipe_id' => array(
'recipe_id',
),
),
'foreign keys' => array(
'brr_recipe' => array(
'table' => 'botcha_recipe',
'columns' => array(
'recipe_id' => 'id',
),
),
'brr_recipebook' => array(
'table' => 'botcha_recipebook',
'columns' => array(
'rbid' => 'id',
),
),
),
);
return $schema;
}