You are here

shouts.install in Heartbeat 6.3

Same filename and directory in other branches
  1. 6.4 modules/shouts/shouts.install

File

modules/shouts/shouts.install
View source
<?php

// by Zuuperman - ONE-agency - www.one-agency.be

/**
 * Implementation of hook_install().
 */
function shouts_install() {
  drupal_install_schema('shouts');
  $types = variable_get('message_types', array());
  $types[] = 'shout';
  variable_set('message_types', $types);
}

/**
 * Implementation of hook_uninstall().
 */
function shouts_uninstall() {
  drupal_uninstall_schema('shouts');
}

/**
 * Implementation of hook_schema().
 */
function shouts_schema() {
  $schema['shouts'] = array(
    'description' => t('Stores shouts of users.'),
    'fields' => array(
      'shout_id' => array(
        'description' => t('The primary identifier for the shout.'),
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'uid' => array(
        'description' => t('The user_id from the user that shouted the message.'),
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'message' => array(
        'description' => t('Message of the shout'),
        'type' => 'text',
        'not null' => FALSE,
        'size' => 'big',
      ),
      'cleared' => array(
        'description' => t('Did the user clear this message?'),
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
      'time' => array(
        'description' => t('Timestamp when the shout has been posted'),
        'type' => 'datetime',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'shout_id',
    ),
  );
  return $schema;
}

Functions

Namesort descending Description
shouts_install Implementation of hook_install().
shouts_schema Implementation of hook_schema().
shouts_uninstall Implementation of hook_uninstall().