You are here

function sharemessage_schema in Share Message 7

Implements hook_schema().

File

./sharemessage.install, line 12
Install hooks for sharemessage module.

Code

function sharemessage_schema() {
  $schema['sharemessage'] = array(
    'description' => 'Contains share messages.',
    'fields' => array(
      'smid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'Message ID.',
      ),
      'label' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => FALSE,
        'default' => '',
        'description' => 'Message Label.',
      ),
      'bundle' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => FALSE,
        'default' => '',
        'description' => 'Message Bundle.',
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => FALSE,
        'default' => '',
        'description' => 'Message Name (machine name).',
      ),
      'status' => array(
        'type' => 'int',
        'not null' => TRUE,
        // Set the default to ENTITY_CUSTOM without using the constant as it is
        // not safe to use it at this point.
        'default' => 0x1,
        'size' => 'tiny',
        'description' => 'The exportable status of the entity.',
      ),
      'module' => array(
        'description' => 'The name of the providing module if the entity has been defined in code.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'changed' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Date of change.',
      ),
      'created' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Creation date.',
      ),
      'override_default_settings' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'size' => 'tiny',
        'description' => 'Override default settings.',
      ),
      'settings' => array(
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
        'serialize' => TRUE,
        'description' => 'A serialized array of additional settings.',
      ),
      'block' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'size' => 'tiny',
        'description' => 'Expose selected share messages as block.',
      ),
    ),
    'primary key' => array(
      'smid',
    ),
    'unique keys' => array(
      'name' => array(
        'name',
      ),
    ),
  );
  return $schema;
}