Skip migration if setting does not exist
This commit is contained in:
parent
ee89dedd0f
commit
ddd538944a
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user