Skip to content

Commit 0a763fb

Browse files
author
Julien Heller
committed
Upgrade to latest edge demux
1 parent 79667da commit 0a763fb

File tree

5 files changed

+17
-10
lines changed

5 files changed

+17
-10
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
},
3434
"dependencies": {
3535
"@types/express": "^4.16.1",
36-
"demux": "5.0.2-500",
36+
"demux": "5.0.2-533",
3737
"massive": "5.11.0"
3838
},
3939
"peerDependencies": {
40-
"demux": "^5.0.0"
40+
"demux": "5.0.2-533"
4141
},
4242
"scripts": {
4343
"build": "tsc && cp -R src/cyanaudit dist",

src/MassiveActionHandler.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ describe('TestMassiveActionHandler', () => {
6666
effects: [],
6767
}],
6868
massiveInstance,
69-
schemaName,
7069
[migrationSequence],
70+
{ dbSchema: schemaName, logLevel: 'error' }
7171
)
7272
await actionHandler.initialize()
7373
await massiveInstance.reload()

src/MassiveActionHandler.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
NonExistentMigrationError,
1414
NonUniqueMigrationSequenceError,
1515
} from './errors'
16-
import { MigrationSequence } from './interfaces'
16+
import { MassiveActionHandlerOptions, MigrationSequence } from './interfaces'
1717
import { Migration } from './Migration'
1818
import { MigrationRunner } from './MigrationRunner'
1919

@@ -38,14 +38,16 @@ export class MassiveActionHandler extends AbstractActionHandler {
3838
protected allMigrations: Migration[] = []
3939
protected migrationSequenceByName: { [key: string]: MigrationSequence } = {}
4040
protected cyanauditEnabled: boolean = false
41+
protected dbSchema: string
4142

4243
constructor(
4344
protected handlerVersions: HandlerVersion[],
4445
protected massiveInstance: Database,
45-
protected dbSchema: string = 'public',
4646
protected migrationSequences: MigrationSequence[] = [],
47+
options: MassiveActionHandlerOptions,
4748
) {
48-
super(handlerVersions)
49+
super(handlerVersions, options)
50+
this.dbSchema = options.dbSchema ? options.dbSchema : 'public'
4951
for (const migrationSequence of migrationSequences) {
5052
if (this.migrationSequenceByName.hasOwnProperty(migrationSequence.sequenceName)) {
5153
throw new NonUniqueMigrationSequenceError()

src/interfaces.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
import { ActionHandlerOptions } from 'demux'
12
import { Migration } from './Migration'
23

34
export interface MigrationSequence {
45
migrations: Migration[]
56
sequenceName: string
67
}
8+
9+
export interface MassiveActionHandlerOptions extends ActionHandlerOptions {
10+
dbSchema?: string
11+
}

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,10 +1239,10 @@ delegates@^1.0.0:
12391239
resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
12401240
integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=
12411241

1242-
1243-
version "5.0.2-500"
1244-
resolved "https://registry.yarnpkg.com/demux/-/demux-5.0.2-%3Cspan%20class="x x-first x-last">500.tgz#08de57b202b4d5a27ca4cb597cdf14d3d73be6c8"
1245-
integrity sha512-B+FETCu3Oi6Saw7Bcu6gG+sbWsz381cwvzF3MqyaTzlnwufib9MipeaZQI6FHPDqqTCMxgupXC6Rg/YRFm4TjQ==
1242+
1243+
version "5.0.2-533"
1244+
resolved "https://registry.yarnpkg.com/demux/-/demux-5.0.2-%3Cspan%20class="x x-first x-last">533.tgz#181c997eef688b30b17e09e45d6114d4863a8e2e"
1245+
integrity sha512-FnPE7rlVmYePOrAAtrBR2NUZ0bPu75SrPBgKdeckBnvA6XmMelVYuH+LArv15Bo5Df7DZb9YVePwH3gjriGcyQ==
12461246
dependencies:
12471247
bunyan "1.8.12"
12481248
express "4.16.4"

0 commit comments

Comments
 (0)