You are here

farm_sensor.install in farmOS 7

Farm sensor install.

File

modules/farm/farm_sensor/farm_sensor.install
View source
<?php

/**
 * @file
 * Farm sensor install.
 */

/**
 * Implements hook_schema().
 */
function farm_sensor_schema() {
  $schema['farm_sensor'] = array(
    'description' => 'Farm sensor',
    'fields' => array(
      'id' => array(
        'description' => 'Asset ID',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'type' => array(
        'description' => 'Sensor type',
        'type' => 'varchar',
        'length' => '255',
        'not null' => FALSE,
      ),
      'settings' => array(
        'description' => 'Sensor settings',
        'type' => 'text',
        'size' => 'big',
        'serialize' => TRUE,
      ),
    ),
    'unique keys' => array(
      'id' => array(
        'id',
      ),
    ),
    'indexes' => array(
      'type' => array(
        'type',
      ),
    ),
  );
  return $schema;
}

Functions

Namesort descending Description
farm_sensor_schema Implements hook_schema().