mirror of
https://github.com/farmOS/farmOS.git
synced 2024-02-23 11:37:38 +01:00
43 lines
856 B
Text
43 lines
856 B
Text
<?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;
|
|
}
|