init
This commit is contained in:
commit
5bcd93fcfc
17 changed files with 2481 additions and 0 deletions
19
src/start.ts
Normal file
19
src/start.ts
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue