Mercurial > hg > cmmr2012-drupal-site
annotate vendor/chi-teck/drupal-code-generator/templates/d7/install.twig @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 /** |
Chris@0 | 4 * @file |
Chris@0 | 5 * Install, update and uninstall functions for the {{ name }} module. |
Chris@0 | 6 */ |
Chris@0 | 7 |
Chris@0 | 8 /** |
Chris@0 | 9 * Implements hook_schema(). |
Chris@0 | 10 */ |
Chris@0 | 11 function {{ machine_name }}_schema() { |
Chris@0 | 12 $schema['{{ machine_name }}_table'] = array( |
Chris@0 | 13 'description' => 'Table description', |
Chris@0 | 14 'fields' => array( |
Chris@0 | 15 'id' => array( |
Chris@0 | 16 'type' => 'serial', |
Chris@0 | 17 'not null' => TRUE, |
Chris@0 | 18 'description' => 'Primary Key: Unique ID.', |
Chris@0 | 19 ), |
Chris@0 | 20 'title' => array( |
Chris@0 | 21 'type' => 'varchar', |
Chris@0 | 22 'length' => 64, |
Chris@0 | 23 'not null' => TRUE, |
Chris@0 | 24 'default' => '', |
Chris@0 | 25 'description' => 'Column description', |
Chris@0 | 26 ), |
Chris@0 | 27 'weight' => array( |
Chris@0 | 28 'type' => 'int', |
Chris@0 | 29 'not null' => TRUE, |
Chris@0 | 30 'default' => 0, |
Chris@0 | 31 'description' => 'Column description', |
Chris@0 | 32 ), |
Chris@0 | 33 ), |
Chris@0 | 34 'primary key' => array('id'), |
Chris@0 | 35 'unique keys' => array( |
Chris@0 | 36 'title' => array('title'), |
Chris@0 | 37 ), |
Chris@0 | 38 'indexes' => array( |
Chris@0 | 39 'weight' => array('weight'), |
Chris@0 | 40 ), |
Chris@0 | 41 ); |
Chris@0 | 42 |
Chris@0 | 43 return $schema; |
Chris@0 | 44 } |