Merge pull request #1394 from umami-software/um-31-prisma-deploy-bug

Prisma Deploy 01_init already completed #1393
This commit is contained in:
Mike Cao 2022-08-10 11:00:08 -05:00 committed by GitHub
commit 2181ca4ec8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,8 +63,11 @@ async function run(cmd, args) {
async function checkMigrations() { async function checkMigrations() {
const output = await run('prisma', ['migrate', 'status']); const output = await run('prisma', ['migrate', 'status']);
console.log(output);
const missingMigrations = output.includes('have not yet been applied'); 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'); const notManaged = output.includes('The current database is not managed');
if (notManaged || missingMigrations) { if (notManaged || missingMigrations) {