2021-06-23 13:20:20 -05:00
|
|
|
const Logger = require('../src/lib/logger');
|
|
|
|
const prismaRun = require('./prisma-run');
|
|
|
|
|
|
|
|
module.exports = async (config) => {
|
|
|
|
try {
|
2021-08-28 13:32:09 -05:00
|
|
|
await prismaRun(config.core.database_url, ['migrate', 'deploy']);
|
|
|
|
await prismaRun(config.core.database_url, ['generate'], true);
|
2021-06-23 13:20:20 -05:00
|
|
|
} catch (e) {
|
2021-08-21 16:57:54 -05:00
|
|
|
console.log(e);
|
2021-06-23 13:20:20 -05:00
|
|
|
Logger.get('db').error('there was an error.. exiting..');
|
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
};
|