From ddd538944af91697d220d0b1a06d82137ba7c933 Mon Sep 17 00:00:00 2001 From: chaptergy Date: Tue, 9 Nov 2021 14:03:39 +0100 Subject: [PATCH] Skip migration if setting does not exist --- backend/migrations/20211108145214_regenerate_default_host.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/migrations/20211108145214_regenerate_default_host.js b/backend/migrations/20211108145214_regenerate_default_host.js index 41feee5..4c50941 100644 --- a/backend/migrations/20211108145214_regenerate_default_host.js +++ b/backend/migrations/20211108145214_regenerate_default_host.js @@ -5,6 +5,10 @@ const internalNginx = require('../internal/nginx'); async function regenerateDefaultHost(knex) { const row = await knex('setting').select('*').where('id', 'default-site').first(); + if (!row) { + return Promise.resolve(); + } + return internalNginx.deleteConfig('default') .then(() => { return internalNginx.generateConfig('default', row);