Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* @file example_entity.install
* Contains install hooks.
*/
/**
* Implements hook_schema().
*/
function example_entity_schema() {
$schema['example_entity'] = array(
'description' => 'The base table for example_entity entity.',
'fields' => array(
'eid' => array(
'description' => 'The primary identifier for a example_entity.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'title' => array(
'description' => 'The title of this entity, always treated as non-markup plain text.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'status' => array(
'description' => 'Boolean indicating whether the entity is published (visible to non-administrators).',
'type' => 'int',
'not null' => TRUE,
'default' => 1,
),
'uid' => array(
// Note this won't get set by the generic form handlers; but we have
// this anyway to demonstrate the 'set owner' operation.
'description' => 'The {users}.uid who owns this entity.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
),
'indexes' => array(
),
'unique keys' => array(
),
'foreign keys' => array(
),
'primary key' => array('eid'),
);
return $schema;
}