Skip to content

Commit f0ba355

Browse files
committed
Bumped to 0.38.7
1 parent 0274408 commit f0ba355

File tree

5 files changed

+23
-20
lines changed

5 files changed

+23
-20
lines changed

docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.5'
2-
31
services:
42
app:
53
build:

package-lock.json

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
},
3939
"homepage": "https://github.com/oskardudycz/EventSourcing.NodeJS#readme",
4040
"dependencies": {
41-
"@event-driven-io/emmett-postgresql": "0.30.0",
42-
"@event-driven-io/emmett-expressjs": "0.30.0"
41+
"@event-driven-io/emmett-postgresql": "0.38.7",
42+
"@event-driven-io/emmett-expressjs": "0.38.7"
4343
},
4444
"devDependencies": {
4545
"@types/node": "20.11.30",

src/guestStayAccounts/businessLogic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const checkIn = (
5555
{ data: { guestId, roomId }, metadata }: CheckIn,
5656
state: GuestStayAccount,
5757
): GuestCheckedIn | [] => {
58-
if (state.status === 'CheckedIn') [];
58+
if (state.status === 'CheckedIn') return [];
5959

6060
if (state.status === 'CheckedOut')
6161
throw new IllegalStateError(`Guest account is already checked out`);

src/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ import { guestStayDetailsProjection } from './guestStayAccounts/guestStayDetails
99

1010
const connectionString =
1111
process.env.POSTGRESQL_CONNECTION_STRING ??
12-
'postgresql://postgres@localhost:5432/postgres';
12+
'postgresql://postgres:postgres@localhost:5432/postgres';
1313

1414
const eventStore = getPostgreSQLEventStore(connectionString, {
1515
projections: projections.inline([guestStayDetailsProjection]),
16+
schema: { autoMigration: 'None' },
1617
});
1718

1819
const readStore = pongoClient(connectionString);
@@ -32,4 +33,8 @@ const application: Application = getApplication({
3233
apis: [guestStayAccounts],
3334
});
3435

35-
startAPI(application);
36+
startAPI(application).on('listening', async () => {
37+
eventStore.schema.print();
38+
await eventStore.schema.migrate();
39+
console.log('Migrations complete.');
40+
});

0 commit comments

Comments
 (0)