@golemio/energetics 1.0.6-dev.402755319 → 1.0.6-dev.441006151
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.
- package/db/migrations/postgresql/.config.json +3 -0
- package/db/migrations/postgresql/20211116133054-init-energetics.js +53 -0
- package/db/migrations/postgresql/20220103101845-electricity-consumption-view.js +53 -0
- package/db/migrations/postgresql/package.json +3 -0
- package/db/migrations/postgresql/sqls/20211116133054-init-energetics-down.sql +41 -0
- package/db/migrations/postgresql/sqls/20211116133054-init-energetics-up.sql +1675 -0
- package/db/migrations/postgresql/sqls/20220103101845-electricity-consumption-view-down.sql +1 -0
- package/db/migrations/postgresql/sqls/20220103101845-electricity-consumption-view-up.sql +8 -0
- package/db/migrations/postgresql/sqls/package.json +3 -0
- package/dist/integration-engine/workers/EnergeticsEnesaWorker.js +3 -0
- package/dist/integration-engine/workers/EnergeticsEnesaWorker.js.map +1 -1
- package/dist/integration-engine/workers/EnergeticsVpalacWorker.js +5 -0
- package/dist/integration-engine/workers/EnergeticsVpalacWorker.js.map +1 -1
- package/dist/schema-definitions/index.d.ts +1 -0
- package/dist/schema-definitions/index.js +1 -0
- package/dist/schema-definitions/index.js.map +1 -1
- package/package.json +3 -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', '20211116133054-init-energetics-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', '20211116133054-init-energetics-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,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', '20220103101845-electricity-consumption-view-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', '20220103101845-electricity-consumption-view-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,41 @@
|
|
|
1
|
+
-- pohledy
|
|
2
|
+
drop VIEW v_vpalac_apartments_daily_consumption;
|
|
3
|
+
drop VIEW v_consumption_gas_reserve;
|
|
4
|
+
drop VIEW v_consumption_energy_vrtbovsky_palac_last_update;
|
|
5
|
+
drop VIEW v_consumption_energy_outside_temperature;
|
|
6
|
+
drop VIEW v_consumption_energy_missing_devices_last_update;
|
|
7
|
+
drop VIEW v_consumption_energy_last_update;
|
|
8
|
+
drop VIEW v_consumption_energy_devices_active;
|
|
9
|
+
|
|
10
|
+
drop VIEW v_consumption_energy_consumption_month_v_f;
|
|
11
|
+
drop VIEW v_consumption_energy_consumption_month_el_f;
|
|
12
|
+
drop VIEW v_consumption_energy_consumption_month_p_f;
|
|
13
|
+
drop VIEW v_consumption_vrtbovsky_palac;
|
|
14
|
+
|
|
15
|
+
drop VIEW v_consumption_energy_buildings_w_data;
|
|
16
|
+
drop VIEW v_consumption_energy_consumption;
|
|
17
|
+
|
|
18
|
+
drop VIEW v_consumption_energy_buildings_real_mc_nogeom;
|
|
19
|
+
drop VIEW v_consumption_energy_buildings_mimo_prahu;
|
|
20
|
+
drop VIEW v_consumption_energy_buildings_real_mc;
|
|
21
|
+
drop VIEW v_consumption_energy_buildings_real;
|
|
22
|
+
|
|
23
|
+
drop VIEW v_consumption_energy_consumption_month_t_f;
|
|
24
|
+
drop VIEW v_consumption_energy_consumption_month_ptv;
|
|
25
|
+
drop VIEW v_consumption_energy_deduct_month_ptv;
|
|
26
|
+
drop VIEW v_consumption_energy_delta;
|
|
27
|
+
drop VIEW v_consumption_energy_change;
|
|
28
|
+
drop VIEW v_consumption_energy_alerts;
|
|
29
|
+
drop VIEW v_consumption_energy_avg_consumption_min;
|
|
30
|
+
|
|
31
|
+
-- tabulky
|
|
32
|
+
drop TABLE vpalac_units ;
|
|
33
|
+
drop TABLE vpalac_type_measuring_equipment;
|
|
34
|
+
drop TABLE vpalac_meter_type;
|
|
35
|
+
drop TABLE vpalac_measuring_equipment;
|
|
36
|
+
drop TABLE vpalac_measurement;
|
|
37
|
+
|
|
38
|
+
drop TABLE consumption_energy_devices;
|
|
39
|
+
drop TABLE consumption_energy_consumption;
|
|
40
|
+
drop TABLE consumption_energy_buildings;
|
|
41
|
+
drop TABLE vpalac_meter_mapping;
|