From 1aa549e3916a6a3fa24d7f2edd8853fd59d0d790 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sat, 25 May 2019 21:23:09 +0300 Subject: [PATCH] Don't run migrations on start (must be run explicitly) --- nodemon.json => nodemon-bot.json | 0 package.json | 3 ++- src/data/{BaseRepository.ts => BaseGuildRepository.ts} | 0 src/index.ts | 4 +--- 4 files changed, 3 insertions(+), 4 deletions(-) rename nodemon.json => nodemon-bot.json (100%) rename src/data/{BaseRepository.ts => BaseGuildRepository.ts} (100%) diff --git a/nodemon.json b/nodemon-bot.json similarity index 100% rename from nodemon.json rename to nodemon-bot.json diff --git a/package.json b/package.json index ed193b5b..f7d0c71b 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "format": "prettier --write \"./**/*.ts\"", "typeorm": "ts-node ./node_modules/typeorm/cli.js", "build": "rimraf dist && tsc", - "start-prod": "cross-env NODE_ENV=production node dist/index.js" + "start-prod": "cross-env NODE_ENV=production node dist/index.js", + "migrate": "npm run typeorm -- migration:run" }, "keywords": [], "author": "", diff --git a/src/data/BaseRepository.ts b/src/data/BaseGuildRepository.ts similarity index 100% rename from src/data/BaseRepository.ts rename to src/data/BaseGuildRepository.ts diff --git a/src/index.ts b/src/index.ts index c982413e..ee2c9701 100644 --- a/src/index.ts +++ b/src/index.ts @@ -73,10 +73,8 @@ import { errorMessage, successMessage } from "./utils"; import { startUptimeCounter } from "./uptime"; // Run latest database migrations -logger.info("Running database migrations"); +logger.info("Connecting to database"); connect().then(async conn => { - await conn.runMigrations(); - const client = new Client(`Bot ${process.env.TOKEN}`, { getAllUsers: true, restMode: true,