Skip migration if setting does not exist

This commit is contained in:
chaptergy 2021-11-09 14:03:39 +01:00
parent ee89dedd0f
commit ddd538944a

View File

@ -5,6 +5,10 @@ const internalNginx = require('../internal/nginx');
async function regenerateDefaultHost(knex) { async function regenerateDefaultHost(knex) {
const row = await knex('setting').select('*').where('id', 'default-site').first(); const row = await knex('setting').select('*').where('id', 'default-site').first();
if (!row) {
return Promise.resolve();
}
return internalNginx.deleteConfig('default') return internalNginx.deleteConfig('default')
.then(() => { .then(() => {
return internalNginx.generateConfig('default', row); return internalNginx.generateConfig('default', row);