Skip to content

Commit 022ab4d

Browse files
authored
NRPT-129: Fix offense string and fix database. (#396)
1 parent 4e56f96 commit 022ab4d

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

angular/projects/common/src/app/utils/record-constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ export class Picklists {
700700
},
701701
'Oil and Gas Activities Act': {
702702
'63': {
703-
description: 'Penalty for failure to compluy with the Act or associated regulations'
703+
description: 'Penalty for failure to comply with the Act or associated regulations'
704704
}
705705
}
706706
},
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
'use strict'
2+
3+
var dbm
4+
var type
5+
var seed
6+
7+
const badString = "Penalty for failure to compluy with the Act or associated regulations"
8+
const goodString = "Penalty for failure to comply with the Act or associated regulations"
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+
};
19+
20+
exports.up = async function(db) {
21+
const mClient = await db.connection.connect(db.connectionString, { native_parser: true })
22+
try {
23+
const nrptiCollection = await mClient.collection('nrpti')
24+
await nrptiCollection.updateMany({offence: badString}, { $set: { offence: goodString } })
25+
mClient.close()
26+
} catch (e) {
27+
console.log('Error', e)
28+
mClient.close()
29+
}
30+
}
31+
32+
exports.down = function(db) {
33+
return null
34+
}
35+
36+
exports._meta = {
37+
"version": 1
38+
}

0 commit comments

Comments
 (0)