-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* adds fileStorageLocation and fileStorageId
- Loading branch information
1 parent
e1417ed
commit d2edfc0
Showing
111 changed files
with
1,775 additions
and
682 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
apps/server/src/migrations/mikro-orm/Migration20240604131554.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Migration } from '@mikro-orm/migrations-mongodb'; | ||
import * as process from 'node:process'; | ||
|
||
export class Migration20240604131554 extends Migration { | ||
async up(): Promise<void> { | ||
// eslint-disable-next-line no-process-env | ||
if (process.env.SC_THEME === 'n21') { | ||
await this.driver.nativeInsert('instances', { | ||
name: 'nbc', | ||
}); | ||
console.info('Instance was added for nbc'); | ||
} | ||
|
||
// eslint-disable-next-line no-process-env | ||
if (process.env.SC_THEME === 'brb') { | ||
await this.driver.nativeInsert('instances', { | ||
name: 'brb', | ||
}); | ||
console.info('Instance was added for brb'); | ||
} | ||
|
||
// eslint-disable-next-line no-process-env | ||
if (process.env.SC_THEME === 'thr') { | ||
await this.driver.nativeInsert('instances', { | ||
name: 'thr', | ||
}); | ||
console.info('Instance was added for thr'); | ||
} | ||
|
||
// eslint-disable-next-line no-process-env | ||
if (process.env.SC_THEME === 'default') { | ||
await this.driver.nativeInsert('instances', { | ||
name: 'dbc', | ||
}); | ||
console.info('Instance was added for default'); | ||
} | ||
} | ||
|
||
async down(): Promise<void> { | ||
await this.getCollection('instances').drop(); | ||
|
||
console.info('Collection "instances" was dropped'); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
apps/server/src/migrations/mikro-orm/Migration20240605065231.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Migration } from '@mikro-orm/migrations-mongodb'; | ||
|
||
export class Migration20240605065231 extends Migration { | ||
async up(): Promise<void> { | ||
const filerecords = await this.driver.nativeUpdate( | ||
'filerecords', | ||
{}, | ||
{ $rename: { schoolId: 'storageLocationId' }, $set: { storageLocation: 'school' } } | ||
); | ||
|
||
console.info(`${filerecords.affectedRows} Filerecords were migrated to "storageLocationId" and "storageLocation"`); | ||
} | ||
|
||
async down(): Promise<void> { | ||
const filerecords = await this.driver.nativeUpdate( | ||
'filerecords', | ||
{}, | ||
{ $rename: { storageLocationId: 'schoolId' }, $unset: { storageLocation: '' } } | ||
); | ||
|
||
console.info(`${filerecords.affectedRows} Filerecords were rolled back to use "schoolId"`); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
apps/server/src/migrations/mikro-orm/Migration20240606142059.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Migration } from '@mikro-orm/migrations-mongodb'; | ||
|
||
export class Migration20240606142059 extends Migration { | ||
async up(): Promise<void> { | ||
const superheroRole = await this.driver.nativeUpdate( | ||
'roles', | ||
{ name: 'superhero' }, | ||
{ | ||
$addToSet: { | ||
permissions: { | ||
$each: ['INSTANCE_VIEW'], | ||
}, | ||
}, | ||
} | ||
); | ||
|
||
if (superheroRole.affectedRows > 0) { | ||
console.info('Permissions INSTANCE_VIEW was added to role superhero.'); | ||
} | ||
} | ||
|
||
async down(): Promise<void> { | ||
const superheroRole = await this.driver.nativeUpdate( | ||
'roles', | ||
{ name: 'superhero' }, | ||
{ | ||
$pull: { | ||
permissions: { | ||
$in: ['INSTANCE_VIEW'], | ||
}, | ||
}, | ||
} | ||
); | ||
|
||
if (superheroRole.affectedRows > 0) { | ||
console.info('Permissions INSTANCE_VIEW was removed to role superhero.'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 9 additions & 9 deletions
18
apps/server/src/modules/authorization/domain/rules/context-external-tool.rule.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
apps/server/src/modules/authorization/domain/rules/course-group.rule.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.