Merge pull request #261 from SELab-2/fix/testdata-niet-meer-correct-opgezet
Some checks failed
Backend Testing / Run backend unit tests (push) Has been cancelled
Frontend Testing / Run frontend unit tests (push) Has been cancelled
Lint / Run linters (push) Has been cancelled

chore: Testdata wordt geëxporteerd en gelinkt
This commit is contained in:
Laure Jablonski 2025-05-17 19:31:23 +02:00 committed by GitHub
commit 57ddc3d608
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 945 additions and 604 deletions

View file

@ -7,12 +7,17 @@ let orm: MikroORM | undefined;
export async function initORM(testingMode = false): Promise<MikroORM<IDatabaseDriver, EntityManager>> {
const logger: Logger = getLogger();
logger.info('Initializing ORM');
logger.debug('MikroORM config is', config);
const options = config(testingMode);
logger.info('MikroORM config is', options);
logger.info('Initializing ORM');
orm = await MikroORM.init(options);
logger.info('MikroORM initialized');
orm = await MikroORM.init(config(testingMode));
// Update the database scheme if necessary and enabled.
if (getEnvVar(envVars.DbUpdate)) {
logger.info('MikroORM: Updating database schema');
await orm.schema.updateSchema();
} else {
const diff = await orm.schema.getUpdateSchemaSQL();