This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
drupalcampbristol/vendor/chi-teck/drupal-code-generator/templates/d7/install.twig
2018-11-23 12:29:20 +00:00

45 lines
966 B
Twig

<?php
/**
* @file
* Install, update and uninstall functions for the {{ name }} module.
*/
/**
* Implements hook_schema().
*/
function {{ machine_name }}_schema() {
$schema['{{ machine_name }}_table'] = array(
'description' => 'Table description',
'fields' => array(
'id' => array(
'type' => 'serial',
'not null' => TRUE,
'description' => 'Primary Key: Unique ID.',
),
'title' => array(
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
'default' => '',
'description' => 'Column description',
),
'weight' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'Column description',
),
),
'primary key' => array('id'),
'unique keys' => array(
'title' => array('title'),
),
'indexes' => array(
'weight' => array('weight'),
),
);
return $schema;
}