Skip to content
example_entity.install 1.37 KiB
Newer Older
<?php
/**
 * @file example_entity.install
 * Contains install hooks.
 */

/**
 * Implements hook_schema().
 */
function example_entity_schema() {
  $schema['example_entity'] = array(
    'description' => 'The base table for example_entity entity.',
    'fields' => array(
      'eid' => array(
        'description' => 'The primary identifier for a example_entity.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'title' => array(
        'description' => 'The title of this entity, always treated as non-markup plain text.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'status' => array(
        'description' => 'Boolean indicating whether the entity is published (visible to non-administrators).',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 1,
      ),
      'uid' => array(
        // Note this won't get set by the generic form handlers; but we have
        // this anyway to demonstrate the 'set owner' operation.
        'description' => 'The {users}.uid who owns this entity.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'indexes' => array(
    ),
    'unique keys' => array(
    ),
    'foreign keys' => array(
    ),
    'primary key' => array('eid'),
  );
  return $schema;
}