annotate sites/all/modules/custom/mediathek/mediathek.install @ 0:015d06b10d37 default tip

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