Skip to content

Commit f3b5a2b

Browse files
author
Daniel Bradley
authored
Merge pull request #111 from o2Labs/2.0-bookings-migration
Enable office bookings migrations
2 parents 4158420 + 40f7f17 commit f3b5a2b

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.2.0] - 2020-09-14
11+
12+
- Migrate DB to store all bookings with office ID rather than office name.
13+
- Temporarily set API to readonly mode to avoid changes during migration.
14+
1015
## [1.1.0] - 2020-09-14
1116

1217
- Introduced users migration to store all active users in DynamoDB.

infrastructure/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ const getHttpEnv = (): aws.types.input.lambda.FunctionEnvironment['variables'] =
414414
DEFAULT_WEEKLY_QUOTA: defaultWeeklyQuota.toString(),
415415
DATA_RETENTION_DAYS: logRetention.toString(),
416416
SHOW_TEST_BANNER: showTestBanner.toString(),
417+
READONLY: 'true',
417418
};
418419
if (caseSensitiveEmail) {
419420
env.CASE_SENSITIVE_EMAIL = 'true';

server/app.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const configureApp = (config: Config) => {
4646
app.get('/api/config', (req, res, next) => {
4747
try {
4848
const clientConfig = {
49-
version: '1.1.0',
49+
version: '1.2.0',
5050
showTestBanner: config.showTestBanner,
5151
auth:
5252
config.authConfig.type === 'cognito'

server/migrations/index.ts

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { options } from 'yargs';
22
import { SSM } from 'aws-sdk';
33
import { parseConfigFromEnv, Config } from '../app-config';
44
import { saveCognitoUsersToDb } from './1-save-users-to-db';
5+
import { duplicateOfficeBooking } from './2-replace-office-booking-ids';
6+
import { moveBookingsToV2 } from './3-move-bookings';
57

68
/** Collection all migrations that should be applied to the system */
79
type Migrations = {
@@ -25,6 +27,12 @@ const migrations: Migrations = {
2527
'1-save-users-to-db': {
2628
execute: saveCognitoUsersToDb,
2729
},
30+
'2-replace-office-booking-ids': {
31+
execute: duplicateOfficeBooking,
32+
},
33+
'3-move-bookings': {
34+
execute: moveBookingsToV2,
35+
},
2836
};
2937

3038
/**

0 commit comments

Comments
 (0)