You are here

function simplenews_scheduler_schema in Simplenews Scheduler 6

Same name and namespace in other branches
  1. 8 simplenews_scheduler.install \simplenews_scheduler_schema()
  2. 6.2 simplenews_scheduler.install \simplenews_scheduler_schema()
  3. 7 simplenews_scheduler.install \simplenews_scheduler_schema()
  4. 2.0.x simplenews_scheduler.install \simplenews_scheduler_schema()

Implementation of hook_schema().

File

./simplenews_scheduler.install, line 18
Install and uninstall functions for the Simplenews Scheduler module.

Code

function simplenews_scheduler_schema() {
  $schema['simplenews_scheduler'] = array(
    'fields' => array(
      'nid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'last_run' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'activated' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
      'interval' => array(
        'type' => 'varchar',
        'length' => 10,
      ),
      'start_date' => array(
        'type' => 'int',
        'not null' => TRUE,
      ),
      'stop' => array(
        'type' => 'int',
        'not null' => TRUE,
      ),
      'stop_date' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 1388447999,
      ),
      // Default is Mon, 31 Dec 2013 23:59:59 GMT
      'stop_edition' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'nid',
    ),
  );
  $schema['simplenews_scheduler_editions'] = array(
    'fields' => array(
      'eid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'pid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'date_issued' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'eid',
    ),
  );
  return $schema;
}