@golemio/microclimate 1.0.3-dev.715813944 → 1.0.3-dev.718071013

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,53 @@
1
+ 'use strict';
2
+
3
+ var dbm;
4
+ var type;
5
+ var seed;
6
+ var fs = require('fs');
7
+ var path = require('path');
8
+ var Promise;
9
+
10
+ /**
11
+ * We receive the dbmigrate dependency from dbmigrate initially.
12
+ * This enables us to not have to rely on NODE_PATH.
13
+ */
14
+ exports.setup = function(options, seedLink) {
15
+ dbm = options.dbmigrate;
16
+ type = dbm.dataType;
17
+ seed = seedLink;
18
+ Promise = options.Promise;
19
+ };
20
+
21
+ exports.up = function(db) {
22
+ var filePath = path.join(__dirname, 'sqls', '20221209095416-pp20221209-up.sql');
23
+ return new Promise( function( resolve, reject ) {
24
+ fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
25
+ if (err) return reject(err);
26
+ console.log('received data: ' + data);
27
+
28
+ resolve(data);
29
+ });
30
+ })
31
+ .then(function(data) {
32
+ return db.runSql(data);
33
+ });
34
+ };
35
+
36
+ exports.down = function(db) {
37
+ var filePath = path.join(__dirname, 'sqls', '20221209095416-pp20221209-down.sql');
38
+ return new Promise( function( resolve, reject ) {
39
+ fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
40
+ if (err) return reject(err);
41
+ console.log('received data: ' + data);
42
+
43
+ resolve(data);
44
+ });
45
+ })
46
+ .then(function(data) {
47
+ return db.runSql(data);
48
+ });
49
+ };
50
+
51
+ exports._meta = {
52
+ "version": 1
53
+ };
@@ -0,0 +1,3 @@
1
+ /* Replace with your SQL commands */
2
+
3
+ drop TABLE sensor_devices_import;
@@ -0,0 +1,39 @@
1
+ /* Replace with your SQL commands */
2
+
3
+ create schema if not exists microclimate;
4
+
5
+ -- aliyoda.microclimate_sensors definition
6
+
7
+ -- Drop table
8
+
9
+ -- DROP TABLE aliyoda.microclimate_sensors;
10
+
11
+ CREATE TABLE sensor_devices_import (
12
+ location_id int4 NULL,
13
+ point_id int4 NULL,
14
+ "location" varchar(50) NULL,
15
+ loc_description varchar(50) NULL,
16
+ loc_orientation varchar(50) NULL,
17
+ loc_surface varchar(50) NULL,
18
+ point_name varchar(50) NULL,
19
+ point_whole_name varchar(50) NULL,
20
+ address varchar(50) NULL,
21
+ sensor_position varchar(50) NULL,
22
+ sensor_position_detail varchar(50) NULL,
23
+ sensor_id varchar(50) primary key,
24
+ data_relevance varchar(50) NULL,
25
+ lat float4 NULL,
26
+ lng float4 NULL,
27
+ air_temp int4 NULL,
28
+ air_hum int4 NULL,
29
+ pressure int4 NULL,
30
+ wind_dir int4 NULL,
31
+ wind_impact int4 NULL,
32
+ wind_speed int4 NULL,
33
+ precip int4 NULL,
34
+ sun_irr int4 NULL,
35
+ soil_temp int4 NULL,
36
+ water_pot int4 NULL,
37
+ dendro_circ int4 NULL,
38
+ dendro_gain int4 NULL
39
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/microclimate",
3
- "version": "1.0.3-dev.715813944",
3
+ "version": "1.0.3-dev.718071013",
4
4
  "description": "Golemio Microclimate Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",