annotate vendor/chi-teck/drupal-code-generator/templates/d7/install.twig @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
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 }