add console log. look for 01 last applied

This commit is contained in:
Brian Cao 2022-08-10 00:01:00 -07:00
parent 5873a56fff
commit b426bbd812

View File

@ -63,8 +63,11 @@ async function run(cmd, args) {
async function checkMigrations() {
const output = await run('prisma', ['migrate', 'status']);
console.log(output);
const missingMigrations = output.includes('have not yet been applied');
const missingInitialMigration = output.includes('01_init');
const missingInitialMigration =
output.includes('01_init') && !output.includes('The last common migration is: 01_init');
const notManaged = output.includes('The current database is not managed');
if (notManaged || missingMigrations) {