You are here

function datereminder_schema in Date Reminder 7

Same name and namespace in other branches
  1. 6.2 datereminder.install \datereminder_schema()
  2. 6 datereminder.install \datereminder_schema()

Implements hook_schema().

Tell Drupal about database tables and content.

File

./datereminder.install, line 43
Stuff Druapl needs to install this module.

Code

function datereminder_schema() {
  $schema['datereminder_enable'] = array(
    'description' => 'Reminder per-node enable flags',
    'fields' => array(
      'nid' => array(
        'description' => 'Primary key: node id',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'enabled' => array(
        'description' => '0: No reminders, 1: Saved reminders, 3: Allow reminders',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'nid',
    ),
  );
  $schema['datereminder'] = array(
    'description' => "Information on user's reminders",
    'fields' => array(
      'rid' => array(
        'description' => 'Primary key, reminder id',
        'type' => 'serial',
        'size' => 'normal',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'nid' => array(
        'description' => 'node id',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'uid' => array(
        'description' => 'user id',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'leadtime' => array(
        'description' => 'How long before event to send reminder in seconds',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'email' => array(
        'description' => 'If allowed, alternate email address',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'expired' => array(
        'description' => "If TRUE, delete after 'next'",
        'type' => 'int',
        'size' => 'tiny',
        'default' => 0,
        'not null' => TRUE,
      ),
      'next_due' => array(
        'description' => 'Time for reminder as Unix epoch',
        'type' => 'int',
        'size' => 'normal',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'rid',
    ),
    'indexes' => array(
      'uid' => array(
        'uid',
      ),
      'nid' => array(
        'nid',
      ),
    ),
  );
  return $schema;
}