@golemio/chmu 1.0.0-dev.696586298 → 1.0.0-dev.700463573

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,3 @@
1
+ {
2
+ "schema": "chmu"
3
+ }
@@ -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', '20221116134217-initial-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', '20221116134217-initial-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
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,2 @@
1
+ drop table chmu.stations;
2
+ drop table chmu.units;
@@ -0,0 +1,42 @@
1
+ create table units (
2
+ zkratka varchar(50) null primary key,
3
+ prvek varchar(250) null,
4
+ jednotka varchar(50) null,
5
+ jmeno_atrinutu varchar(50),
6
+ poznámka text null,
7
+ create_batch_id int8 null,
8
+ created_at timestamptz null,
9
+ created_by varchar(150) null,
10
+ update_batch_id int8 null,
11
+ updated_at timestamptz null,
12
+ updated_by varchar(150) null
13
+ );
14
+
15
+ create table stations (
16
+ station_id varchar(50) primary key,
17
+ name text,
18
+ type varchar(50),
19
+ coordinate_lng float,
20
+ coordinate_lat float,
21
+ coordinate_lng_2 varchar(50),
22
+ coordinate_lat_2 varchar(50),
23
+ Gx_sum float,
24
+ Gy_sum float,
25
+ elevation float,
26
+ district varchar(250),
27
+ region varchar(250),
28
+ soil_hum boolean,
29
+ air_temp boolean,
30
+ air_hum boolean,
31
+ precip boolean,
32
+ wind_speed boolean,
33
+ wind_dir boolean,
34
+ air_pressure boolean,
35
+ sunlight boolean,
36
+ create_batch_id int8 null,
37
+ created_at timestamptz null,
38
+ created_by varchar(150) null,
39
+ update_batch_id int8 null,
40
+ updated_at timestamptz null,
41
+ updated_by varchar(150) null
42
+ );
@@ -0,0 +1,2 @@
1
+ alter table units
2
+ rename column jmeno_atributu to jmeno_atrinutu;
@@ -0,0 +1,2 @@
1
+ alter table units
2
+ rename column jmeno_atrinutu to jmeno_atributu;
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/chmu",
3
- "version": "1.0.0-dev.696586298",
3
+ "version": "1.0.0-dev.700463573",
4
4
  "description": "Golemio CHMU module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",