feat: add initial database migration

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2023-10-08 15:08:57 +02:00 committed by Philip Molares
parent 09698579a7
commit f8f198f9c9
7 changed files with 1082 additions and 5 deletions

View file

@ -200,8 +200,9 @@ export class TestSetupBuilder {
type: 'sqlite',
database: ':memory:',
autoLoadEntities: true,
synchronize: true,
dropSchema: true,
migrations: [`src/migrations/sqlite-*.ts`],
migrationsRun: true,
};
case 'postgres':
case 'mariadb':
@ -211,8 +212,11 @@ export class TestSetupBuilder {
username: 'hedgedoc',
password: 'hedgedoc',
autoLoadEntities: true,
synchronize: true,
dropSchema: true,
migrations: [
`src/migrations/${process.env.HEDGEDOC_TEST_DB_TYPE}-*.ts`,
],
migrationsRun: true,
};
default:
throw new Error('Unknown database type in HEDGEDOC_TEST_DB_TYPE');