You are here

nodejs_subscribe.install in Node.js integration 7

Same filename and directory in other branches
  1. 6 nodejs_subscribe/nodejs_subscribe.install

File

nodejs_subscribe/nodejs_subscribe.install
View source
<?php

/**
 * Implements hook_schema().
 */
function nodejs_subscribe_schema() {
  return array(
    'nodejs_subscribe_subscription' => array(
      'description' => 'Stores user subscriptions to nodes.',
      'fields' => array(
        'nid' => array(
          'type' => 'int',
          'unsigned' => TRUE,
          'not null' => TRUE,
        ),
        'uid' => array(
          'type' => 'int',
          'unsigned' => TRUE,
          'not null' => TRUE,
        ),
      ),
      'unique keys' => array(
        'name' => array(
          'nid',
          'uid',
        ),
      ),
    ),
    'nodejs_subscribe_node' => array(
      'description' => 'Stores per-node settings related to subscriptions.',
      'fields' => array(
        'nid' => array(
          'type' => 'int',
          'unsigned' => TRUE,
          'not null' => TRUE,
        ),
        'subscribe' => array(
          'description' => 'Defines whether the node can be subscribed to (1) or not (0).',
          'type' => 'int',
          'unsigned' => TRUE,
        ),
      ),
      'primary key' => array(
        'nid',
      ),
    ),
  );
}

/**
 * Create the {nodejs_subscribe_node} table.
 */
function nodejs_subscribe_update_7000() {
  $schema = nodejs_subscribe_schema();
  db_create_table('nodejs_subscribe_node', $schema['nodejs_subscribe_node']);
}

Functions

Namesort descending Description
nodejs_subscribe_schema Implements hook_schema().
nodejs_subscribe_update_7000 Create the {nodejs_subscribe_node} table.