Pull merge.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / install.twig
1 <?php
2
3 /**
4  * @file
5  * Install, update and uninstall functions for the {{ name }} module.
6  */
7
8 /**
9  * Implements hook_schema().
10  */
11 function {{ machine_name }}_schema() {
12   $schema['{{ machine_name }}_table'] = array(
13     'description' => 'Table description',
14     'fields' => array(
15       'id' => array(
16         'type' => 'serial',
17         'not null' => TRUE,
18         'description' => 'Primary Key: Unique ID.',
19       ),
20       'title' => array(
21         'type' => 'varchar',
22         'length' => 64,
23         'not null' => TRUE,
24         'default' => '',
25         'description' => 'Column description',
26       ),
27       'weight' => array(
28         'type' => 'int',
29         'not null' => TRUE,
30         'default' => 0,
31         'description' => 'Column description',
32       ),
33     ),
34     'primary key' => array('id'),
35     'unique keys' => array(
36       'title' => array('title'),
37     ),
38     'indexes' => array(
39       'weight' => array('weight'),
40     ),
41   );
42
43   return $schema;
44 }