annotate sites/all/modules/custom/digitalobjects/digitalobjects.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 *
015d06b10d37 initial
dwinter
parents:
diff changeset
14 * All implementations of hook_field_schema() must be in the module's
015d06b10d37 initial
dwinter
parents:
diff changeset
15 * .install file.
015d06b10d37 initial
dwinter
parents:
diff changeset
16 *
015d06b10d37 initial
dwinter
parents:
diff changeset
17 * @see http://drupal.org/node/146939
015d06b10d37 initial
dwinter
parents:
diff changeset
18 * @see schemaapi
015d06b10d37 initial
dwinter
parents:
diff changeset
19 * @see hook_field_schema()
015d06b10d37 initial
dwinter
parents:
diff changeset
20 * @ingroup field_example
015d06b10d37 initial
dwinter
parents:
diff changeset
21 */
015d06b10d37 initial
dwinter
parents:
diff changeset
22
015d06b10d37 initial
dwinter
parents:
diff changeset
23 function digitalobjects_field_schema($field) {
015d06b10d37 initial
dwinter
parents:
diff changeset
24
015d06b10d37 initial
dwinter
parents:
diff changeset
25 $columns = array(
015d06b10d37 initial
dwinter
parents:
diff changeset
26 'objid' => array('type' => 'varchar', 'length' => 20, 'not null' => FALSE),
015d06b10d37 initial
dwinter
parents:
diff changeset
27 );
015d06b10d37 initial
dwinter
parents:
diff changeset
28 $indexes = array(
015d06b10d37 initial
dwinter
parents:
diff changeset
29 'objid' => array('objid'),
015d06b10d37 initial
dwinter
parents:
diff changeset
30 );
015d06b10d37 initial
dwinter
parents:
diff changeset
31 return array(
015d06b10d37 initial
dwinter
parents:
diff changeset
32 'columns' => $columns,
015d06b10d37 initial
dwinter
parents:
diff changeset
33 'indexes' => $indexes,
015d06b10d37 initial
dwinter
parents:
diff changeset
34 );
015d06b10d37 initial
dwinter
parents:
diff changeset
35 }