nodejs_subscribe.install in Node.js integration 6
Same filename and directory in other branches
File
nodejs_subscribe/nodejs_subscribe.installView 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',
),
),
);
}
/**
* Implements hook_install().
*/
function nodejs_subscribe_install() {
drupal_install_schema('nodejs_subscribe');
}
/**
* Create the {nodejs_subscribe_node} table.
*/
function nodejs_subscribe_update_7000() {
//$schema = nodejs_subscribe_schema();
//drupal_install_schema('nodejs_subscribe');
// db_create_table('nodejs_subscribe_node', $schema['nodejs_subscribe_node']);
}
Functions
Name | Description |
---|---|
nodejs_subscribe_install | Implements hook_install(). |
nodejs_subscribe_schema | Implements hook_schema(). |
nodejs_subscribe_update_7000 | Create the {nodejs_subscribe_node} table. |