This commit is contained in:
sam 2023-07-31 21:31:51 +02:00
commit 5bcd93fcfc
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
17 changed files with 2481 additions and 0 deletions

19
src/start.ts Normal file
View file

@ -0,0 +1,19 @@
import "reflect-metadata"; // Required for TypeORM
import TypeORMDataSource from "~/db/index.js";
import log from "~/log.js";
export default async function start() {
log.info("Initializing database");
await TypeORMDataSource.initialize();
const pendingMigrations = await TypeORMDataSource.showMigrations();
if (pendingMigrations) {
log.error(
"There are pending migrations, please run these with `pnpm migrate`.",
);
return;
}
// add your logic below this line
}