You are here

regcode_mailer.install in Registration codes 6

Install, uninstall and scheme functions for the regcode_mailer module.

File

regcode_mailer/regcode_mailer.install
View source
<?php

/**
 * @file
 * Install, uninstall and scheme functions for the regcode_mailer module.
 */

/**
 * Implementation of hook_uninstall().
 */
function regcode_mailer_uninstall() {
  drupal_uninstall_schema('regcode_mailer');
}

/**
 * Implementation of hook_install().
 */
function regcode_mailer_install() {
  drupal_install_schema('regcode_mailer');
}

/**
 * Update from 6.x-1.5 to 6.x-1.6
 */
function regcode_mailer_update_6001() {
  $updates = array();
  $updates[] = 'ALTER TABLE regcode_mailer ADD is_sent int(1) UNSIGNED NOT NULL DEFAULT 0 AFTER rid';
  return $updates;
}

/**
 * Implementation of hook_schema().
 */
function regcode_mailer_schema() {
  $schema['regcode_mailer'] = array(
    'description' => t('Registration code mailer information'),
    'fields' => array(
      'id' => array(
        'description' => t('Mail ID'),
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'disp-width' => '11',
      ),
      'rid' => array(
        'description' => t('Regcode ID'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
        'disp-width' => '11',
      ),
      'is_sent' => array(
        'description' => t('Whether the code is sent'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
        'disp-width' => '11',
      ),
      'mailed' => array(
        'description' => t('The date code was mailed'),
        'type' => 'datetime',
        'not null' => FALSE,
      ),
      'recipient' => array(
        'description' => t('The address the code was mailed to'),
        'type' => 'varchar',
        'length' => '255',
        'not null' => FALSE,
      ),
    ),
    'primary key' => array(
      'id',
    ),
  );
  return $schema;
}

Functions

Namesort descending Description
regcode_mailer_install Implementation of hook_install().
regcode_mailer_schema Implementation of hook_schema().
regcode_mailer_uninstall Implementation of hook_uninstall().
regcode_mailer_update_6001 Update from 6.x-1.5 to 6.x-1.6