X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd7%2Fhook%2Fschema.twig;fp=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd7%2Fhook%2Fschema.twig;h=3294edfc40a84af62dd0473740b5a1d9f80014b4;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/schema.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/schema.twig new file mode 100644 index 000000000..3294edfc4 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/schema.twig @@ -0,0 +1,60 @@ +/** + * Implements hook_schema(). + */ +function {{ machine_name }}_schema() { + $schema['node'] = array( + // Example (partial) specification for table "node". + 'description' => 'The base table for nodes.', + 'fields' => array( + 'nid' => array( + 'description' => 'The primary identifier for a node.', + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + 'vid' => array( + 'description' => 'The current {node_revision}.vid version identifier.', + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'type' => array( + 'description' => 'The {node_type} of this node.', + 'type' => 'varchar', + 'length' => 32, + 'not null' => TRUE, + 'default' => '', + ), + 'title' => array( + 'description' => 'The title of this node, always treated as non-markup plain text.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + ), + 'indexes' => array( + 'node_changed' => array('changed'), + 'node_created' => array('created'), + ), + 'unique keys' => array( + 'nid_vid' => array('nid', 'vid'), + 'vid' => array('vid'), + ), + // For documentation purposes only; foreign keys are not created in the + // database. + 'foreign keys' => array( + 'node_revision' => array( + 'table' => 'node_revision', + 'columns' => array('vid' => 'vid'), + ), + 'node_author' => array( + 'table' => 'users', + 'columns' => array('uid' => 'uid'), + ), + ), + 'primary key' => array('nid'), + ); + return $schema; +}