@golemio/waze-tt 1.2.1 → 1.2.2-dev.1183052218
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', '20240220071811-pp20240220-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', '20240220071811-pp20240220-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,49 @@
|
|
|
1
|
+
CREATE TABLE wazett_jams_stats_old (
|
|
2
|
+
feed_id int4 NOT NULL,
|
|
3
|
+
update_time int8 NOT NULL,
|
|
4
|
+
jam_level int4 NOT NULL,
|
|
5
|
+
wazers_count numeric NULL,
|
|
6
|
+
length_of_jams int4 NULL,
|
|
7
|
+
created_at timestamptz NULL,
|
|
8
|
+
updated_at timestamptz NULL,
|
|
9
|
+
create_batch_id int8 NULL,
|
|
10
|
+
created_by varchar(150) NULL,
|
|
11
|
+
update_batch_id int8 NULL,
|
|
12
|
+
updated_by varchar(150) NULL,
|
|
13
|
+
CONSTRAINT wazett_jams_stats_pkey PRIMARY KEY (feed_id, update_time, jam_level)
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
CREATE TABLE wazett_route_lives_old (
|
|
17
|
+
route_id int8 NOT NULL,
|
|
18
|
+
update_time int8 NOT NULL,
|
|
19
|
+
"time" int4 NULL,
|
|
20
|
+
length int4 NULL,
|
|
21
|
+
historic_time int4 NULL,
|
|
22
|
+
jam_level int4 NULL,
|
|
23
|
+
create_batch_id int8 NULL,
|
|
24
|
+
created_at timestamptz NULL,
|
|
25
|
+
created_by varchar(150) NULL,
|
|
26
|
+
update_batch_id int8 NULL,
|
|
27
|
+
updated_at timestamptz NULL,
|
|
28
|
+
updated_by varchar(150) NULL,
|
|
29
|
+
CONSTRAINT wazett_route_lives_pkey PRIMARY KEY (update_time, route_id)
|
|
30
|
+
);
|
|
31
|
+
CREATE INDEX wazett_route_lives_old_idx ON wazett.wazett_route_lives_old USING btree (update_time);
|
|
32
|
+
|
|
33
|
+
CREATE TABLE wazett_subroute_lives_old (
|
|
34
|
+
route_id int8 NOT NULL,
|
|
35
|
+
subroute_line_md5 uuid NOT NULL,
|
|
36
|
+
update_time int8 NOT NULL,
|
|
37
|
+
"time" int4 NULL,
|
|
38
|
+
length int4 NULL,
|
|
39
|
+
historic_time int4 NULL,
|
|
40
|
+
jam_level int4 NULL,
|
|
41
|
+
create_batch_id int8 NULL,
|
|
42
|
+
created_at timestamptz NULL,
|
|
43
|
+
created_by varchar(150) NULL,
|
|
44
|
+
update_batch_id int8 NULL,
|
|
45
|
+
updated_at timestamptz NULL,
|
|
46
|
+
updated_by varchar(150) NULL,
|
|
47
|
+
CONSTRAINT wazett_subroute_lives_pk PRIMARY KEY (route_id, update_time, subroute_line_md5)
|
|
48
|
+
);
|
|
49
|
+
CREATE INDEX wazett_subroute_lives_old_idx ON wazett.wazett_subroute_lives_old USING btree (update_time);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/waze-tt",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2-dev.1183052218",
|
|
4
4
|
"description": "Golemio Waze TT Module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -66,4 +66,4 @@
|
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"@golemio/core": ">=1.5.0"
|
|
68
68
|
}
|
|
69
|
-
}
|
|
69
|
+
}
|