@stamhoofd/backend 2.79.3 → 2.79.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stamhoofd/backend",
3
- "version": "2.79.3",
3
+ "version": "2.79.4",
4
4
  "main": "./dist/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -38,14 +38,14 @@
38
38
  "@simonbackx/simple-encoding": "2.21.0",
39
39
  "@simonbackx/simple-endpoints": "1.19.1",
40
40
  "@simonbackx/simple-logging": "^1.0.1",
41
- "@stamhoofd/backend-i18n": "2.79.3",
42
- "@stamhoofd/backend-middleware": "2.79.3",
43
- "@stamhoofd/email": "2.79.3",
44
- "@stamhoofd/models": "2.79.3",
45
- "@stamhoofd/queues": "2.79.3",
46
- "@stamhoofd/sql": "2.79.3",
47
- "@stamhoofd/structures": "2.79.3",
48
- "@stamhoofd/utility": "2.79.3",
41
+ "@stamhoofd/backend-i18n": "2.79.4",
42
+ "@stamhoofd/backend-middleware": "2.79.4",
43
+ "@stamhoofd/email": "2.79.4",
44
+ "@stamhoofd/models": "2.79.4",
45
+ "@stamhoofd/queues": "2.79.4",
46
+ "@stamhoofd/sql": "2.79.4",
47
+ "@stamhoofd/structures": "2.79.4",
48
+ "@stamhoofd/utility": "2.79.4",
49
49
  "archiver": "^7.0.1",
50
50
  "aws-sdk": "^2.885.0",
51
51
  "axios": "1.6.8",
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "gitHead": "3b9878a9052295f3c5f9a661fbb8219ed87b23fe"
68
+ "gitHead": "db09440c68c3af4e7b834b2a739f717e302fbc7c"
69
69
  }
@@ -0,0 +1,32 @@
1
+ import { Migration } from '@simonbackx/simple-database';
2
+ import { Event, Group } from '@stamhoofd/models';
3
+ import { sleep } from '@stamhoofd/utility';
4
+
5
+ export default new Migration(async () => {
6
+ if (STAMHOOFD.environment === 'test') {
7
+ console.log('skipped in tests');
8
+ return;
9
+ }
10
+
11
+ if (STAMHOOFD.platformName !== 'ravot') {
12
+ console.log('skipped for platform (only runs for Ravot): ' + STAMHOOFD.platformName);
13
+ return;
14
+ }
15
+
16
+ let count = 0;
17
+ for await (const event of Event.select().where('groupId', '!=', null).limit(20).all()) {
18
+ // Sync group requirements
19
+ if (event.groupId) {
20
+ const group = await Group.getByID(event.groupId);
21
+ if (group) {
22
+ await event.syncGroupRequirements(group);
23
+ count += 1;
24
+
25
+ // Slow this down a bit to reduce a lot of document updates at the same time
26
+ await sleep(100);
27
+ }
28
+ }
29
+ }
30
+
31
+ console.log('Fixed ' + count + ' groups');
32
+ });
@@ -78,7 +78,6 @@ export class AuditLogService {
78
78
  }
79
79
 
80
80
  if (this.isDisabled()) {
81
- console.log('Audit log disabled');
82
81
  return;
83
82
  }
84
83