You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-1
Original file line number
Diff line number
Diff line change
@@ -135,7 +135,6 @@ Please ensure to create the index `submission-test` or the index specified in th
135
135
export ES_INDEX=submission-test
136
136
```
137
137
138
-
139
138
#### Running unit tests and coverage
140
139
141
140
To run unit tests alone
@@ -172,6 +171,26 @@ To migrate the existing data from DynamoDB to ES, run the following script
172
171
npm run db-to-es
173
172
```
174
173
174
+
#### Store v5 challenge id for current records
175
+
176
+
Submission API started off using the legacy challenge ids. With the v5 upgrade to the challenge api, we now need to make use of the v5 challenge ids. We have thus created a script to update existing `challengeId` attribute on submissions to v5 and store the older challenge ids in the `legacyChallengeId` attribute.
177
+
178
+
To update the existing challengeId data on submissions in DynamoDB to v5 challengeId, set the following env variables:
179
+
180
+
```bash
181
+
SUBMISSION_TABLE_NAME // Table name of the submission records. Defaults to 'Submission'
182
+
UPDATE_V5_CHALLENGE_BATCH_SIZE // Number of records that are updated simultaneously. Defaults to 250
183
+
FETCH_CREATED_DATE_START // The start day of fetch latest challenges. Defaults to '2021-01-01'
184
+
FETCH_PAGE_SIZE // The page size of each api request. Defaults to 500
185
+
```
186
+
187
+
188
+
and then run the following script
189
+
190
+
```
191
+
npm run update-to-v5-challengeId
192
+
```
193
+
175
194
#### Swagger UI
176
195
177
196
Swagger UI will be served at `http://localhost:3000/docs`
0 commit comments