You are here

kraken.install in Kraken 7.2

Same filename and directory in other branches
  1. 7 kraken.install

kraken.install Code for installing, updating and removing kraken.

File

kraken.install
View source
<?php

/**
 * @file kraken.install
 * Code for installing, updating and removing kraken.
 */

/**
 * Implements hook_schema().
 */
function kraken_schema() {
  $schema['kraken'] = array(
    'description' => 'This is the table that logs kraken operations',
    'fields' => array(
      'kid' => array(
        'description' => 'kraken ID number',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'fid' => array(
        'description' => 'fid from the file_managed table',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'ops' => array(
        'description' => 'Operations carried out on image prior to submission to kraken',
        'type' => 'blob',
        'size' => 'big',
        'not null' => TRUE,
      ),
      'original_size' => array(
        'description' => 'Original image size in bytes',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'kraked_size' => array(
        'description' => "Krak'd size",
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'saved_bytes' => array(
        'description' => 'Amount of data saved',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'timestamp' => array(
        'description' => 'Unix timestamp of when the file was returned from kraken.io',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'uid' => array(
        'description' => 'User who submitted the kraken job',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'kid',
    ),
  );
  return $schema;
}

/**
 * Implements hook_uninstall().
 */
function kraken_uninstall() {
  variable_del('kraken');
}

/**
 * Adds the kraken logging table.
 */
function kraken_update_7100() {
  $schema['kraken'] = array(
    'description' => 'This is the table that logs kraken operations',
    'fields' => array(
      'kid' => array(
        'description' => 'kraken ID number',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'fid' => array(
        'description' => 'fid from the file_managed table',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'ops' => array(
        'description' => 'Operations carried out on image prior to submission to kraken',
        'type' => 'blob',
        'size' => 'big',
        'not null' => TRUE,
      ),
      'original_size' => array(
        'description' => 'Original image size in bytes',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'kraked_size' => array(
        'description' => "Krak'd size",
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'saved_bytes' => array(
        'description' => 'Amount of data saved',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'timestamp' => array(
        'description' => 'Unix timestamp of when the file was returned from kraken.io',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'uid' => array(
        'description' => 'User who submitted the kraken job',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'kid',
    ),
  );
  db_create_table('kraken', $schema['kraken']);
}

Functions

Namesort descending Description
kraken_schema Implements hook_schema().
kraken_uninstall Implements hook_uninstall().
kraken_update_7100 Adds the kraken logging table.