swaf/test/_registerMigrations.ts
2020-04-23 11:40:55 +02:00

15 lines
528 B
TypeScript

import CreateMigrationsTable from "../src/migrations/CreateMigrationsTable";
import CreateLogsTable from "../src/migrations/CreateLogsTable";
import MysqlConnectionManager from "../src/db/MysqlConnectionManager";
let migrationsRegistered = false;
export default function registerMigrations() {
if (!migrationsRegistered) {
migrationsRegistered = true;
[
CreateMigrationsTable,
CreateLogsTable,
].forEach(m => MysqlConnectionManager.registerMigration(v => new m(v)));
}
}