0
|
1 <?php
|
|
2 /**
|
|
3 * @file
|
|
4 * Install, update, and uninstall functions for the field_example module.
|
|
5 */
|
|
6
|
|
7 /**
|
|
8 * Implements hook_field_schema().
|
|
9 *
|
|
10 * Defines the database schema of the field, using the format used by the
|
|
11 * Schema API.
|
|
12 *
|
|
13 * The data we will store here is just one 7-character element, even
|
|
14 * though the widget presents the three portions separately.
|
|
15 *
|
|
16 * All implementations of hook_field_schema() must be in the module's
|
|
17 * .install file.
|
|
18 *
|
|
19 * @see http://drupal.org/node/146939
|
|
20 * @see schemaapi
|
|
21 * @see hook_field_schema()
|
|
22 * @ingroup field_example
|
|
23 */
|
|
24 function mediathek_field_schema($field) {
|
|
25
|
|
26 $columns = array(
|
|
27 'url' => array('type' => 'varchar', 'length' => 600, 'not null' => FALSE),
|
|
28 'width' => array('type' => 'varchar', 'length' => 10, 'not null' => FALSE),
|
|
29 'height' => array('type' => 'varchar', 'length' => 10, 'not null' => FALSE),
|
|
30 );
|
|
31 $indexes = array(
|
|
32 'url' => array('url'),
|
|
33 );
|
|
34 return array(
|
|
35 'columns' => $columns,
|
|
36 'indexes' => $indexes,
|
|
37 );
|
|
38 }
|