You are here

function notifications_custom_schema in Notifications 6

Same name and namespace in other branches
  1. 6.4 notifications_custom/notifications_custom.install \notifications_custom_schema()

Implementation of hook_schema().

File

notifications_custom/notifications_custom.install, line 23

Code

function notifications_custom_schema() {
  $schema['notifications_custom'] = array(
    'description' => 'Stores custom subscriptions information.',
    'fields' => array(
      'csid' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique custom subscription ID.',
      ),
      'title' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
        'description' => 'Title of the field shown to the end user.',
      ),
      'type' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => FALSE,
        'description' => 'Type of subscription.',
      ),
      'module' => array(
        'description' => 'Module that defines this custom subscription.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Internal name of the field used in the form HTML and URLs.',
      ),
      'explanation' => array(
        'type' => 'text',
        'not null' => FALSE,
        'description' => 'Explanation of the subscription to end users.',
      ),
      'event_type' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => FALSE,
        'description' => 'Type of event that triggers this subscription.',
      ),
      'weight' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'size' => 'tiny',
        'description' => 'Weight of subscription for forms.',
      ),
      'required' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'size' => 'tiny',
        'description' => 'Whether the user is required to enter a value. (0 = no, 1 = yes)',
      ),
      'register' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'size' => 'tiny',
        'description' => 'Whether the subscription is visible in the user registration form. (1 = yes, 0 = no)',
      ),
      'visibility' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'size' => 'tiny',
        'description' => 'The level of visibility for the field. (0 = only admin, 1 = user editable)',
      ),
      'default_value' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'size' => 'tiny',
        'description' => 'Whether it is enabled by default. (0 = disabled, 1 = enabled)',
      ),
      'fields' => array(
        'type' => 'text',
        'not null' => FALSE,
        'serialize' => TRUE,
        'description' => 'Serialized field and other aditional information.',
      ),
    ),
    'primary key' => array(
      'csid',
    ),
  );
  return $schema;
}