Fix event table.

This commit is contained in:
Mike Cao 2022-08-05 13:07:20 -07:00
parent 62b032ab19
commit 7ae457669b
4 changed files with 47 additions and 68 deletions

View file

@ -10,6 +10,10 @@ function success(msg) {
console.log(chalk.greenBright(`${msg}`));
}
function error(msg) {
console.log(chalk.redBright(`${msg}`));
}
async function checkEnv() {
if (!process.env.DATABASE_URL) {
throw new Error('DATABASE_URL is not defined.');
@ -34,6 +38,7 @@ async function checkTables() {
success('Database tables found.');
} catch (e) {
error('Database tables not found.');
console.log('Adding tables...');
console.log(execSync('prisma migrate deploy').toString());