You are here

function farm_sensor_schema in farmOS 7

Implements hook_schema().

File

modules/farm/farm_sensor/farm_sensor.install, line 11
Farm sensor install.

Code

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;
}