You are here

function epub_schema in Epub 6

Implementation of hook_schema().

File

./epub.install, line 37
ePub module' s installation file.

Code

function epub_schema() {
  $schema['epub'] = array(
    'description' => 'Allows the user to download the ePub conversion for a "book" content',
    'fields' => array(
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not NULL' => TRUE,
        'default' => 0,
        'description' => "The ePub' s page {node}.nid.",
      ),
      'vid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not NULL' => TRUE,
        'default' => 0,
        'description' => "The ePub' s page {node}.vid.",
      ),
      'bid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not NULL' => TRUE,
        'default' => 0,
        'description' => "The book outline the ePub is connected to.",
      ),
      'author_name' => array(
        'type' => 'varchar',
        'length' => 127,
        'description' => 'Name of the person who has written the book.',
      ),
      'language_code' => array(
        'type' => 'varchar',
        'length' => 2,
        'description' => 'RFC3066 Language codes, such as "en", "da", "fr", ...',
      ),
      'identifier' => array(
        'type' => 'text',
        'description' => "The ePub' s ISBN number, preferred for published books, or a UUID.",
      ),
      'identifier_type' => array(
        'type' => 'text',
        'description' => "The ePub' s identifier type, ie: ISBN, ISSN, UUID, ...",
      ),
      'creation_date' => array(
        'type' => 'datetime',
        'not null' => TRUE,
        'description' => "Date in which the ePub was created.",
      ),
      'publisher_name' => array(
        'type' => 'text',
        'description' => 'Name of the person or the company who is publishing the book.',
      ),
      'publisher_site' => array(
        'type' => 'text',
        'description' => 'Site of the person or the company who is publishing the book.',
      ),
      'rights' => array(
        'type' => 'text',
        'description' => 'Copyright and license information specific for the ePub.',
      ),
      'source_url' => array(
        'type' => 'text',
        'description' => 'URL where you will find the ePub',
      ),
    ),
    'primary key' => array(
      'nid',
      'vid',
    ),
    'indexes' => array(
      'bid' => array(
        'bid',
      ),
    ),
  );
  return $schema;
}